+ Start a Discussion

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:

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){


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