Roll-Up Summary Field

A Roll-Up Summary Field in Salesforce is a custom field on the parent object of a Master-Detail relationship that aggregates values from related child records. It supports four types of calculations: COUNT (number of child records), SUM, MIN, and MAX (of a field on child records). Unlike a Formula Field, which calculates within a single record and evaluates at runtime, a Roll-Up Summary Field aggregates across related records and stores its calculated value in the database.

PRACTICAL EXAMPLE

A sales team wants to see the total revenue of all open Opportunities on each Account. The admin creates a Roll-Up Summary Field called “Sum of Opportunities” on the Account object, with Amount as the Field to Aggregate on the Opportunity object and SUM as the calculation type. Whenever an Opportunity is created, updated, or deleted, the Roll-Up Summary Field on the Account recalculates automatically.

Quick Facts

  • Requires a Master-Detail relationship: Standard roll-up summary fields are created on the master side of a Master-Detail relationship. They aren’t available for a standard Lookup relationship. This is one reason to choose a Master-Detail relationship when you need native roll-up summary fields.

  • Four calculation types: Salesforce supports four roll-up types: COUNT (number of related records), SUM (total of a numeric field), MIN (lowest value), and MAX (highest value). SUM works with number, currency, and percent fields. MIN and MAX work with number, currency, percent, date, and date/time fields.

  • Automatic recalculation: the value updates automatically when child records are created, updated, or deleted. Larger recalculations (from configuration changes or manual triggers) can take up to 30 minutes.

  • Cannot convert Master-Detail to Lookup after creation: once a Roll-Up Summary Field is created on the parent object, the Master-Detail relationship cannot be converted to a Lookup relationship. This affects long-term schema flexibility.

  • Referenced fields cannot be deleted: after a Roll-Up Summary Field is created, the field it aggregates on the child object cannot be deleted, and the detail object selection cannot be changed.

  • Auto number fields cannot be aggregated: auto number fields are not available as the Field to Aggregate in a Roll-Up Summary.

  • Field-Level Security on child does not block aggregation: even if users cannot see a child field due to FLS, its value is still included in the Roll-Up Summary calculation. Apply FLS to the Roll-Up Summary Field itself on the parent object to control visibility.

  • Aggregates one level at a time: Roll-Up Summary Fields work only on directly related child records. To aggregate across multiple levels (subdetail through detail to master), create intermediate Roll-Up Summary Fields at each level.

Warning icon

Note

Roll-Up Summary Fields can aggregate values from Formula Fields, but with important restrictions. Formula Fields that use cross-object references (like Parent__r.Field__c) or dynamic functions (NOW, TODAY, DATEVALUE) cannot be selected as the Field to Aggregate. This is one of the most common admin pain points when redesigning existing formula fields. A common workaround is to create a Flow that copies the formula value into a non-formula field of the same type, then aggregate the non-formula field.

FAQ

When should I use a Roll-Up Summary Field in Salesforce?

Use a Roll-Up Summary Field when you need to display an aggregate value from related child records (COUNT, SUM, MIN, or MAX) on a parent record. Common use cases include summing invoice amounts per account or displaying the earliest opportunity close date on an account. If aggregation is not needed or the records are only loosely related (Lookup), consider Formula Fields, Flows, or reports instead.


When is a Roll-Up Summary Field calculated in Salesforce?

Roll-Up Summary Fields automatically recalculate when changes to related detail records affect the summarized value. Certain changes, such as changes to the roll-up definition, referenced formula expressions, picklist values or record type definitions, currency conversion rates, and price book entries, can trigger a mass recalculation. You can also select Force a mass recalculation of this field manually. These recalculations can take up to 30 minutes, depending on the number of records affected and other factors.


How many levels does a Roll-Up Summary Field aggregate in Salesforce?

A Roll-Up Summary Field aggregates values from directly related child records only, one level at a time. To aggregate values across multiple levels (for example, subdetail records rolled up through detail to master), create intermediate Roll-Up Summary Fields on each level. Master-Detail relationships support up to 3 custom detail levels total (master to detail to subdetail).