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 

Salesforce MVP | Lightning Champion | 16x Salesforce Certified | Application Architect | 6x Trailhead Ranger | Techforce Services | Australia

Leave a Reply

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

*