January 2015
Beginner to intermediate
302 pages
6h 56m
English
A neat side effect of the SOAP web service methods we just wrote is that they are now accessible via JavaScript thanks to the AJAX toolkit. What this means to you is that if you have a very simple operation to perform, where going to the edit page is a nuance and a Visualforce page is overkill, you can create an OnClick JavaScript button. The following snippet is your template:
//Required Import Statements
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/32.0/apex.js")}
//Call your method, replace variables as needed
sforce.apex.execute("CLASS NAME", "METHOD NAME",{PARAM : '{!VALUE}' });
//Refresh the page to show updates to current record
location.reload(true);If you are not actually modifying ...
Read now
Unlock full access