0

Please find below the code of Button

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


var callout = sforce.apex.execute(
     "AnalyzeObjectExportCtrl",
    "exportToExcel",
    {param:"{!FldUtl__Object_Analysis__c.Id}"}); 

if (callout == 'OK') { 
    alert("Your Request is Successful. Click OK and please wait while the page refreshes"); 
    window.location.reload(); 
} 
else { 
    alert("Request Failed " + callout ); 
}

Onclick of a button below error in the Image is fired.... Please Help!!!

enter image description here

1
  • If the below answer addressed your problem, please consider accepting it by clicking on the check mark/tick to the left of the answer, turning it green. This marks the question as resolved to your satisfaction, and awards reputation both to you and the person who answered. If you have >= 15 reputation points, you may also upvote the answer if you wish. There is no obligation to do either.
    – Adrian Larson
    Oct 30, 2017 at 16:33

1 Answer 1

3

Maybe you don't have a AnalyzeObjectExportCtrl.exportToExcel method...

If you do, check that it is declared as Webservice Static String.

If you have a namespace for this class, you shoud call like this

var callout = sforce.apex.execute(
"YourNamespace.AnalyzeObjectExportCtrl",
"exportToExcel",
{param:"{!FldUtl__Object_Analysis__c.Id}"});
1
  • 1
    @Rajesh When you get a moment, please check the on the answer so it can help others find this solution.
    – sfdcfox
    Sep 26, 2017 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .