You build a roll-up summary as a custom field on the master object of a master-detail relationship. The relationship must already exist before the Roll-Up Summary data type appears in the field wizard.
- Open the master object field setup
In Setup, go to Object Manager, open the master (parent) object, choose Fields and Relationships, then click New. Pick Roll-Up Summary as the data type. If that type is missing, the object has no master-detail child, so create the relationship first.
- Name the field
Enter a clear Field Label such as Total Won Amount or Number of Line Items. Salesforce fills the API name automatically. Add a help text description so other admins understand what the field totals.
- Choose the summarized object and roll-up type
Select the detail (child) object whose records you want to aggregate, then choose COUNT, SUM, MIN, or MAX. For SUM, MIN, or MAX, also pick the child field to calculate. COUNT needs no field.
- Add filter criteria (optional)
To include only some child records, set filter conditions on child fields, for example Stage equals Closed Won. Leave the filter empty to include every related record.
- Set security and layout, then save
Set field-level security so the right profiles can see the field, add it to the page layouts where it should appear, then save. Salesforce calculates the value for existing records right away.
The display name shown on layouts and reports, such as Total Won Amount.
The detail (child) object whose records are aggregated; selectable only from master-detail children.
One of COUNT, SUM, MIN, or MAX, which determines how the child records are combined.
The numeric or date field on the child to summarize; required for SUM, MIN, and MAX, not for COUNT.
- The Roll-Up Summary data type only appears on objects that are the master in a master-detail relationship, never on lookup parents.
- You cannot change the summarized detail object after the field is created; you would have to delete and rebuild the field.
- SUM accepts only Number, Currency, and Percent fields, while MIN and MAX also accept Date and Date/Time fields.
- Each object allows 25 roll-up summary fields by default; Salesforce can raise the cap to 40, and edition limits still apply.