function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PallaviPallavi 

sforce.connection.sessionId = "{!$Api.Session_ID}"; does not work!

Hi

 

I am working on a old code. The line  sforce.connection.sessionId = "{!$Api.Session_ID}"; does not work anymore and prevents any other code line to get executed!!

 

Any Suggestions/ Alternatives?

 

Thanks

Pallavi

Praful GadgePraful Gadge

Is this line in JavaScript?
Have you added "<script src="/soap/ajax/20.0/connection.js" type="text/javascript"></script>" connection file?

mk2013mk2013

Praful,

I am also getting same error and I do have the follwing line in my onclick javascript button code.

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 

 

Any idea what is the problem?

mk2013

Praful GadgePraful Gadge

@mk2013,

 

This should be the exact sequence.

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")}

sforce.connection.sessionId = '{!$Api.Session_ID}';