We need to track the LastModifiedDate field. But LastModifiedDate is a standard field and not able to set to track the field history.
So, Is there any option to track that field?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityWe need to track the LastModifiedDate field. But LastModifiedDate is a standard field and not able to set to track the field history.
So, Is there any option to track that field?
Last_ModifiedDate__c
System.now()
You need to Create a Custom Field of Type Date and you need to copy the value of Last Modified Date Field to the Custom Field.
You can do this via WF Rule OR Trigger.
Below is the step for WF Rule.
In WF Rule Criteria, you can add the condition like this:
ISCHANGED(LastModifiedDate )
In WF Action,You need to create WF Field Update. Specify the field that you want to update(in this case your custom date field).
In Specify New Field Value,click on 'Use a formula to set the new value' and add the below value: LastModifiedDate
Let me know if it helps.
@Sfdcprog, Trigger is possible to track lastmodifieddate. i tried below code. this is helpful for you
if(Trigger.isupdate){
for(Account a:Trigger.new)
{
if(a.Test__c != system.trigger.OldMap.get(a.Id).Test__c){
if(a.Test__c=='Active' && a.Test__c!=null){
a.Last_Time_Changed__c= system.today();
}
else{
a.Last_Time_Changed__c= null;
}
}
}