I have an existing JavaScript button that calls Apex, and it works fine. I then want to add a second parameter to the method, but for some reason it isn't working. Is there something else I need to do?
The code below works:
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var response = sforce.apex.execute("IFE/IFE_ButtonMethods", "createIQuoteCall", {oppID:"{!Opportunity.Id}"});
The Apex method that goes with it:
webservice static string createIQuoteCall(String oppID)
{
This following does not work:
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var response = sforce.apex.execute("IFE/IFE_ButtonMethods", "createIQuoteAcc", {oppID:"{!Opportunity.Id}"}, {accId:"{!Opportunity.AccountId}"});
The Apex method that goes with it:
webservice static string createIQuoteAcc(String oppID, String accId)
{
The error I get is:
onSuccess not defined in the callback.
What am I doing wrong?
apex.execute
call is a synchronous callout not sure why you're getting thecallback
error..