Update Date values in Salesforce Custom button

to example to update the date custom field called AssignementDate__c field in Lead object then use the below code in the custom button logic

var lead = new sforce.SObject(“Lead”);
lead.AssignementDate__c = new Date();
lead.Id = “{!lead.Id}”;
updateLead = sforce.connection.update([lead]);

Written by 

2x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *