w3web.net -- update parent field from child object

Trigger to update parent records field when child record is updated

Hey guys, today in this post we are going to learn about How to update the parent record field based on child record trigger in Salesforce custom object

Real time scenarios:- Write a trigger on custom object where update parent records field whenever child record is inserted or updated.

Create two custom object, both are associated with lookup relationship with each other

1) Custom Object:- parentObjTrigger__c custom field:- Status__c (Checkbox boolean type)
2) Custom Object:- childObjTrigger__c custom field:- Status__c (Checkbox boolean type)

If status field of child object marked true then should be status field of parent object automatic marked as true.

Files we used in this post example:-

checkboxStatus.apxt Apex Class Trigger It is used for update parent object field based on child records

Custom Parent Object:- parentObjTrigger__c

Custom Field :- Status__c


Custom Parent Object with Custom Field It is parent custom object used for building a lookup relationship with childObjTrigger__c

Custom Child Object:- childObjTrigger__c

Custom Field:- Status__c

Custom Child Object with Custom Field It is child custom object that is lookup relationship and associated with parentObjTrigger__c

You can download file directly from github by click here

Final Output

w3web.net -- update parent records field from child object

Other related post that would you like to learn.

Step 1:- Apex Class Trigger : checkboxStatus.apxt

From Developer Console >> File >> New >> Apex Trigger

checkboxStatus.apxt [Apex Class Controller]

Other related post that would you like to learn

To Find Some Important Additional Information
If you think you and your family members also like to earn money in additional time, then go this link. In this site, you can earn money for the lifetime at low effort. To Earn Unlimited Everyday With This Trick, Sign Up Free and Get Magic.. Get Started for Free

8 thoughts on “Trigger to update parent records field when child record is updated”

  1. You’re a beautiful inspiration. It really helps me in any situation. Where I stuck. Many of my friends told me to comment there post but I stuck what I should comment. Finally I got your post it always help me. Thanks for the lovely post.


Leave a Comment