You need to sign in to do that
Don't have an account?
JLB
faultcode:'sf:Invalid_session_id' error in custom component inside visul force page
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
HI JLB,
How I can understand this is, accessing Salesforce Content throug Javascript is same like using Force.com API. When we are making API call, we need to first login and then we get access to the salesforce instance.
You can try the below code to Login through Javascript:
Once you login, you can access.
This is a button sitting in a related list on a case screen.
We have the same problem for several months already. It occurs seldom when users click on the "submit for approval" custom button at opportunities. It works fine with Chrome and Firefox but sometimes it doesn't work with Internet Explorer. It is a browser issue as the same opportunity works fine with Chrome or Firefox.
Pd: We have the latest IE versión (11) with all security patches installed
Any help on this issue would be greatly appreciated.
Best regards,