I have a date/time field and account for some of the fields in account. Now i need to create a javascript button on ACCOUNT that should compare account date field with the last updated date from account history, any idea's here please


1 Answer 1


The following example may help you. Here Time_Zone__c is the Custom Date/Time field it's will compare with standard field in sales force of LastModifiedDate.


var accID = "{!Account.Id}";
var qry = "SELECT Time_Zone__c, LastModifiedDate FROM Account WHERE Id = '"+accID+"'";
var accountList = sforce.connection.query(qry);

records = accountList.getArray("records");

    //Do operation
} else{
    //Do operation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .