2

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?

3

@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;
          }
    }


}
|improve this answer|||||
2
  1. Add a custom field Last_ModifiedDate__c
  2. Track Field history on that new field
  3. Use a before insert and before update trigger to set the value to System.now()
|improve this answer|||||
  • 1
    To learn Triggers, you can start here: Triggers Intro Trailhead. Try to accomplish what you want, and if you are stuck at somewhere in the code, try posting it here. People at SFSE are here to help fix the blockers, not to do someone else's work. Cheers. – Arnold Jr. Oct 10 '17 at 17:38
1

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.

  1. Create a WF Rule for the object.
  2. In WF Rule Criteria, you can add the condition like this:

    ISCHANGED(LastModifiedDate )

  3. 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).

  4. In Specify New Field Value,click on 'Use a formula to set the new value' and add the below value: LastModifiedDate

  5. Activate the WF Rule.
  6. Verify if the value copies properly or not,if copied then you can track the custom date field in Field tracking history.

Let me know if it helps.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.