• JLB
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi -

 

I am getting an error when clicking a custom javascript button from a related list on Case in the service console, but only in Internet Explorer (8). Chrome works fine.

 

The error is: faultstring"INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"

 

The button is:

{!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")}
{!REQUIRESCRIPT("/support/console/27.0/integration.js")} //Chrome worked without this, not sure if it is doing anything now
{!REQUIRESCRIPT("/soap/ajax/27.0/apex.js")}

var profile = "{!$Profile.Name}";
var LockedBy = "{!Case.Locked_ById__c}";
var CompletedBy = "{!Target__c.Completed_By__c}";
var Now = new Date();
var t = new sforce.SObject("Target__c");
t.id = "{!Target__c.Id}";

if(profile.search("Service")>=0 || profile.search("System Administrator")>=0) {
	if("{!Case.Locked_ById__c}" == "{!$User.Id}") {
		if(CompletedBy=="") {
			t.Completed_By__c = "{!$User.Id}";
			t.Date_Completed__c = Now;
                        sforce.connection.init('{!$Api.Session_ID}', 'https://ap1.salesforce.com/services/Soap/u/27.0'); // have tried several things in here. Chrome works fine without this line at all.
			result = sforce.connection.update([t]);
			location.reload();
//and so on...

 I have made many attempts at solving this with no luck so far.

 

Thanks in advance for any assistance,

JLB

  • April 04, 2013
  • Like
  • 0

Hi -

 

I am getting an error when clicking a custom javascript button from a related list on Case in the service console, but only in Internet Explorer (8). Chrome works fine.

 

The error is: faultstring"INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"

 

The button is:

{!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")}
{!REQUIRESCRIPT("/support/console/27.0/integration.js")} //Chrome worked without this, not sure if it is doing anything now
{!REQUIRESCRIPT("/soap/ajax/27.0/apex.js")}

var profile = "{!$Profile.Name}";
var LockedBy = "{!Case.Locked_ById__c}";
var CompletedBy = "{!Target__c.Completed_By__c}";
var Now = new Date();
var t = new sforce.SObject("Target__c");
t.id = "{!Target__c.Id}";

if(profile.search("Service")>=0 || profile.search("System Administrator")>=0) {
	if("{!Case.Locked_ById__c}" == "{!$User.Id}") {
		if(CompletedBy=="") {
			t.Completed_By__c = "{!$User.Id}";
			t.Date_Completed__c = Now;
                        sforce.connection.init('{!$Api.Session_ID}', 'https://ap1.salesforce.com/services/Soap/u/27.0'); // have tried several things in here. Chrome works fine without this line at all.
			result = sforce.connection.update([t]);
			location.reload();
//and so on...

 I have made many attempts at solving this with no luck so far.

 

Thanks in advance for any assistance,

JLB

  • April 04, 2013
  • Like
  • 0