Cert++
Close

Roll-up summary parent updates re-entering the save order

Key Takeaway

When saving a child record changes a roll-up summary field on its parent (master) record, the parent goes through its own save procedure in the same transaction. The parent's validation rules, triggers, assignment rules, workflow rules and after-save record-triggered flows can then run.

A roll-up summary field shows a value on a master (parent) record, such as a count or a total. Salesforce calculates that value from the record's related detail (child) records. When a child record is saved, Salesforce recalculates the parent's roll-up near the end of the child's save. The parent record then goes through its own save procedure. Because of this second save, one child edit can run the parent's validation rules and triggers, block the child save, or even update a grandparent record.

What a roll-up summary field is

A roll-up summary field lives on the master side of a master-detail relationship. The field can COUNT the related detail records, or calculate the SUM, MIN or MAX of a field on them.

A custom Trip object is the master of a custom Expense object. Trip has a roll-up summary field called Total Expenses that uses SUM on the Expense amount field. A trip with two expenses of 200 and 350 shows 550 in Total Expenses.

Platform Administrator II Study Guide

Checklist progress

0/290Learned

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Platform Administrator II studiers.