function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vaibhab ShahVaibhab Shah 

Track Lastmodified date


Hi,

I need to find whether lastmodified is changed after certain time ie.10 am. How to achieve this in formula field?

Rgds,
Vai.
VinayVinay (Salesforce Developers) 
Hi Vaibhab,

Create a Custom Field of Type Date and you need to copy the value of Last Modified Date Field to the Custom Field.

Below is the step for WF Rule.

>> Create a WF Rule for the object.
> 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
> Activate the WF Rule.
>Verify if the value copies properly or not,if copied then you can track the custom date field in Field tracking history.

>> As other option you can try below trigger snippet.

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_ModifiedDate__c= system.today();
          }
          else{
            a.Last_ModifiedDate__c= null;
          }
    }}}

>> Review below link.
https://developer.salesforce.com/forums/?id=9060G000000Xi4rQAC

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar