Skip to content

Instantly share code, notes, and snippets.

@sbob-sfdc
Created September 2, 2012 23:39
Show Gist options
  • Save sbob-sfdc/3605659 to your computer and use it in GitHub Desktop.
Save sbob-sfdc/3605659 to your computer and use it in GitHub Desktop.
Workshop 201, Tutorial 4, Step 1, Apex
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var result = sforce.apex.execute("InvoiceUtilities","renumberLineItems",{invoice:"{!Invoice__c.Name}"});
alert(result);
window.location.reload();
@apocsve
Copy link

apocsve commented Oct 16, 2014

Well the code that worked for me was this:

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var result = sforce.apex.execute("InvoiceUtilities","renumberLineItems",{"invoiceName":"{!Factura__c.Name}"});
alert(result);
window.location.reload();

If somebody need it.

@Bala81
Copy link

Bala81 commented Mar 30, 2015

Change the class type from public to global and method signature type from public to webservice

@sanjay-a3logics
Copy link

I have used all but not working alll

@sanjay-a3logics
Copy link

can you please help in this

@cmorganatsfdc
Copy link

@sanjay-a3logics

In the button code, "InvoiceUtilities" should be "invoiceUtilities" with small i for invoice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment