0

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

1 Answer 1

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.

{!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/37.0/apex.js")}

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");

if(records[0].Time_Zone__c==records[0].LastModifiedDate){
    //alert('True');
    //Do operation
} else{
    //alert('False');
    //Do operation
}

You must log in to answer this question.

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