
How can I retrieve existing 'Opportunity' object with java script (on Sales application)?
------------------------- custom button's javaScript 'onClick' section --------------------
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}//Get Opportunity object var op = "{<Retrieve Opportunity Object>}";//Call insertJob method by passing that Opportunity objectsforce.apex.execute("JobService","insertJob",{o:op});------------------------------------------------------------------------------------------------------------------------ Apex Class ------------------------------------
global class JobService {
webService static void insertJob(Opportunity o) { }}------------------------------------------------------------------------------------