Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionarySSummary Field
AnalyticsAdvanced

Summary Field

A Summary Field, more precisely called a Roll-Up Summary Field, is a read-only field on the master object in a master-detail relationship that automatically calculates an aggregate value from its related detail (child) records.

§ 01

Definition

A Summary Field, more precisely called a Roll-Up Summary Field, is a read-only field on the master object in a master-detail relationship that automatically calculates an aggregate value from its related detail (child) records. It can count those child records or compute the sum, minimum, or maximum of a field on them, and it recalculates on its own whenever a child record is added, changed, or removed.

Because the calculation runs on the platform, you get a live total on the parent record with no Apex, no Flow, and no scheduled job. The trade-off is the relationship requirement: a roll-up summary needs a true master-detail link, not a lookup, so the choice affects how you model the data.

§ 02

How Roll-Up Summary Fields Aggregate Detail Records

The four roll-up types and what they do

Every roll-up summary field uses one of four operations. COUNT returns the number of detail records related to the master, so a field like Number of Contacts on an Account just tallies the children. SUM adds up the values of a single numeric field across all related records, which is how an Opportunity totals the prices of its line items. MIN returns the lowest value found across the children, and MAX returns the highest. A common MIN use is the earliest created date among related records, giving you a "first activity" date without any code. COUNT works on its own and needs no target field, since it only cares how many records exist. The other three must point at a specific field on the child object. The result is always a single value stored on the parent. That value is recalculated by the platform, so you never edit it directly and it never drifts out of sync with the underlying detail records. This automatic, server-side behavior is the main reason admins reach for roll-up summaries before building anything custom.

Which field types each roll-up allows

The roll-up type you pick limits which child fields you can summarize, and getting this wrong is a frequent point of confusion. When you choose SUM, only Number, Currency, and Percent fields appear in the picker, because you can only add up things that are numeric. When you choose MIN or MAX, the list widens to include Number, Currency, Percent, Date, and Date/Time fields, since a lowest or highest value makes sense for dates as well as numbers. COUNT, as noted, needs no field at all. This matters when you plan a data model. If you want to roll up a status or a picklist, a direct roll-up summary will not do it, because those are not numeric. The usual pattern is to first create a numeric or checkbox-driven helper field on the child (often a formula that returns 1 or 0), then SUM that helper. Currency roll-ups also follow the parent record currency in multi-currency orgs, and Salesforce converts child amounts as needed. Knowing the allowed types up front saves you from designing a roll-up that the field wizard will refuse to build.

Why master-detail is required, not lookup

A roll-up summary is only available on the master side of a master-detail relationship. You cannot add one to the parent of a lookup relationship, and this single rule drives a lot of data-model decisions. Master-detail ties the child tightly to the parent: the child inherits the parent sharing and ownership, and deleting the parent cascade-deletes the children. Lookup is looser, allowing the child to stand alone and the link to be optional. If you need a live total but only have a lookup, you have two choices. You can convert the lookup to master-detail, which is possible only when every child already has a parent populated, or you replace the roll-up with code or a tool. Record-triggered Flow can recalculate a parent number when children change, and the free managed package DLRS (Declarative Lookup Rollup Summaries) brings roll-up behavior to lookup relationships. Each alternative adds moving parts that the native roll-up avoids, so when the data genuinely has a parent-child ownership pattern, master-detail plus a roll-up summary is usually the cleaner design.

Filtering which child records count

Roll-up summaries do not have to include every child record. The field setup includes optional filter criteria, so you can restrict the calculation to records that meet conditions you define. On an Account that sums Opportunity amounts, you might count only opportunities where Stage equals Closed Won, giving you a true won-revenue figure instead of a pipeline mix. On an Order, you might sum only line items where a Type field equals Product and ignore services. Filters use the child record fields, and you can combine several conditions with AND or OR logic. This turns one field type into many useful metrics on the same parent. You could have one roll-up for total opportunity amount and a second, filtered roll-up for closed-won amount, both living on the Account at the same time. Keep in mind that the filter is evaluated by the platform on every recalculation, so the totals stay accurate as child records move in and out of the filter. Plan filters carefully, because changing them later forces a full recalculation of the field across all parent records.

Limits, recalculation, and what you cannot change

Roll-up summary fields count against a per-object cap. By default an object allows 25 roll-up summary fields, and Salesforce support can raise that ceiling to 40 on request, subject to edition limits. Each roll-up also adds processing when child records change in bulk, so a heavily loaded detail object with many roll-ups can slow large data operations. Group related metrics thoughtfully rather than creating a roll-up for every conceivable slice. Some choices lock once the field exists. You cannot change the detail object a roll-up summarizes after you create it, and any child field referenced by a roll-up cannot be deleted while the roll-up depends on it. If a total ever looks wrong, an admin can force a recalculation from the field definition so the value rebuilds from current data. Deleting a child record triggers a recalculation automatically, though records sitting in the Recycle Bin are excluded from the total. Encrypted fields and certain formula fields are not eligible as roll-up targets, so confirm the source field qualifies before you design around it.

A worked example on Account and Opportunity

Picture the standard Account to Opportunity relationship. Suppose you want each Account to show total won revenue and the date of its first deal. You add a SUM roll-up on Account that summarizes the Opportunity Amount field, then add a filter so only opportunities with Stage equal to Closed Won are included. The moment any opportunity is set to Closed Won, the Account total climbs by that amount, and if the deal is later reopened, the total drops again, all without a single line of code. For the first-deal date, you add a MIN roll-up on Account that summarizes the Opportunity Created Date. The Account now shows the earliest opportunity date among its children. If the oldest opportunity is deleted, the platform recalculates and the next-earliest date appears. These two fields together give sales managers a clean view of customer value and tenure directly on the Account page. The same pattern scales to Orders and line items, projects and tasks, or any custom parent and child you connect with master-detail.

§ 03

Create a Roll-Up Summary Field

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Field Labelrequired

The display name shown on layouts and reports, such as Total Won Amount.

Summarized Objectrequired

The detail (child) object whose records are aggregated; selectable only from master-detail children.

Roll-Up Typerequired

One of COUNT, SUM, MIN, or MAX, which determines how the child records are combined.

Field to Aggregaterequired

The numeric or date field on the child to summarize; required for SUM, MIN, and MAX, not for COUNT.

Gotchas
  • 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.
§

Trust & references

Sources

Cross-checked against the following references.

Official documentation

Straight from the source - Salesforce's reference material on Summary Field.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.

About the Author

Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.

§

Test your knowledge

Q1. What is a Summary Field?

Q2. What operations are supported?

Q3. What relationship type is required?

§

Discussion

Loading…

Loading discussion…