You need to sign in to do that
Don't have an account?
OnDem Dev
"Sforce not defined" javascript error alert when Custom button is clicked.
Hi,
From past few days, i am facing a problem when i click the custom button.
It shows a javascript error "sforce not defined".
Prior to winter'09 release, this issue was not there.
Is anyone else facing this issue.
Any help on this will be highly appreciated.
Thanks,
OnDemand
Found the solution,
Have to include the below script in the Custom Button Javascript code
{!requireScript("/soap/ajax/13.0/apex.js")}
Thanks
All Answers
Hi,
First line of the code in custom button javascript is
var co = sforce.apex.execute('Post','dothat',{});
And after that is the code to process the above result.
Thanks,
OnDemand
No, i am working with IE7.
Were you able to find a solution.
Thanks,
OnDemand
Found the solution,
Have to include the below script in the Custom Button Javascript code
{!requireScript("/soap/ajax/13.0/apex.js")}
Thanks
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
{!requireScript("/soap/ajax/13.0/apex.js")}
I am using the above code but still I am getting this error..
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!requireScript("/soap/ajax/29.0/apex.js")}
try using latest version.
and try to test it by deleting all the javascript and and just add the below code:
alert ('test1');
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!requireScript("/soap/ajax/29.0/apex.js")}
alert ('test2');
And on click of your javascript button, you should get these two alerts, and if there is an alert that means there is some issue in your rest of the javascript code...
=========
Another solution: Check under profile .. If "API Enabled" is checked or not. It should be checked.