I have a custom button in a salesforce page, and I want that when I click it, an apex method is executed. I follow the tutorial here but I get an error when I click it:
{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/DevisToFacture}createFacture, please check the WSDL for the service.', }
Here is the javascript I put when I created the custom button :
{!requireScript("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var result = sforce.apex.execute("QuoteToInvoice","createInvoice",{idQuote:"{!Quote.Id}"});
alert(result);
window.location.reload();
My apex class is named QuoteToInvoice
(it is a public with sharing class
), the method is named createInvoice
and it has a parameter idQuote
whose type is Id
.
Do you have any idea of what I'm doing wrong ?