You need to sign in to do that
Don't have an account?
ndrannapareddy
Invoke Method from custom button
{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var retStr;
retStr = sforce.apex.execute("SF_Rockport", "callRockport",{ID:"!Transaction__c.Id}"});
alert('The method returned: ' + retStr);
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var retStr;
retStr = sforce.apex.execute("SF_Rockport", "callRockport",{ID:"!Transaction__c.Id}"});
alert('The method returned: ' + retStr);
1. User's profile not having access to the SF_Rockport class
2. The class being a part of a separate namespace will need to be prefixed accordingly before invocation