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
James_AdapxJames_Adapx 

button error

Here is the entire error

"A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:client',faultstring: ' No operation available for request
{http://soap.sforce.com/schemas/package/sumTotal}getTotal, please check the WSDL for the service.',}"


I am trying to call a class from a button and passing in a parameter like this:

The javaScript:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
var opt1 = "{!Opportunity.Id}";

var accts = sforce.apex.execute("sumTotal","getTotal", {opt:opt1});


the class I am calling looks like this.

public class sumTotal{

public static double getTotal(Opportunity opt){

}}


werewolfwerewolf
You have neglected to make your Apex class a webService so it's unavailable to your javascript.  That's the problem.
James_AdapxJames_Adapx
Thank YOU!