last modified date of a custom object -- w3web.net

Trigger to Update the Custom Last Modified Date Field in the Parent Object When the Records in the Child Object is Updated Using Apex Trigger in Salesforce

Hey guys, today in this post we are going to learn about how to how to update the Custom last modified date field in the parent object when the Records in the child object is updated using Apex Trigger in Salesforce.

Real time scenarios:- Write a trigger on Child object and update the custom Last Modified Date Field, LastModifiedDate__c (Date/Time Type) in the Parent Object When the Records in the Child Object is Updated.

parentObjTrigger:- Custom Fields & Relationships

Create a custom field on parent Object name as LastModifiedDate__c (Date/Time Type).

childObjTrigger:- Custom Fields & Relationships

Create a lookup relationship field on child Object name as childLookup__c :: Lookup(parentObjTrigger).

Files we used in this post example:-

LastModifiedDateTrigger.apxt Apex Class Trigger It will be fired whenever update a record on child object

Parent Cusotm Object:- parentObjTrigger__c

Custom Field:- LastModifiedDate__c

Lightning Component Trigger on child custom object and update the custom Last Modified Date Field in the Parent Object Whenever the records in the Child Object is changed.

Child Custom Object:- childObjTrigger__c

Custom Field:- childLookup__c : Lookup(parentObjTrigger)

Child Object with Custom Lookup Field childLookup__c : Lookup(parentObjTrigger) field it is help to communicate between parent object.

Final Output

Update the Custom Last Modified Date Field in the Parent Object -- w3web.net

Other post that would you like to learn

Step 1:- Apex Class Trigger : LastModifiedDateTrigger.apxt

Other related post that would you like to learn…

Leave a Comment

Contribute to Support If Some Value Added in Your Project or Website