Play Games

Search This Blog

Friday, November 15, 2013

How to update a custom field using on click javascript?

How to update a custom field using on click javascript?

Here updating amount2__c of account object
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}

var newRecords = [];
var c = new sforce.SObject("Account");
c.id ="{!Account.Id}";
c.amount2__c = '400';
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();

No comments:

Post a Comment