Skip to main content
Data

What is Roll-Up Summary Field in Salesforce?

Updated · By the Clientell AI team · How we write

A roll-up summary field is a Salesforce field on a master record that calculates a value from its detail records. It can count the detail records, or find the sum, minimum or maximum of a detail field. You can create one only on the master side of a master-detail relationship, not on a plain lookup.

Key facts

What it does
Counts detail records, or sums, finds the minimum or maximum of a detail field (Salesforce Help)
Where it lives
On the object on the master side of a master-detail relationship
Also works on
Opportunities (from products), accounts (from opportunities), campaigns (from campaign members) (Salesforce Help)
Limit
25 roll-up summary fields per object by default. Support can raise it to a hard maximum of 40 (Salesforce Help).
Not for lookups
A plain lookup relationship does not support roll-up summary fields
Fields you can aggregate
Number, currency, percent, date and date/time (Salesforce Help)

Clientell AI, the AI Salesforce admin, documents how Roll-Up Summary Field is used in your org in a read-only scan, and flags anything risky or unused. See org documentation

Try it in Clientell AI

“Document how Roll-Up Summary Field is used in my org and list anything that looks risky or unused.”

Clientell AI reads your org first. Platform deployments include rollback. How security works.

Start the 14-day free trial, no card

What is a roll-up summary field in Salesforce?

A roll-up summary field shows one number about a parent record's children. Examples: the number of open cases on an account, the total value of line items on an order, or the latest date among a project's tasks.

There are four roll-up types. Each one reads the detail records of the master.

TypeResultExample
COUNTThe number of detail recordsNumber of Invoice_Line__c records on an Invoice__c
SUMThe total of a field in the detail recordsTotal of Invoice_Line__c.Amount__c
MINThe lowest value of a field in the detail recordsEarliest due date
MAXThe highest value of a field in the detail recordsLatest activity date

Where can you create a roll-up summary field?

Roll-up summary fields live on the master side of a master-detail relationship. Salesforce Help lists these places (Salesforce Help):

  • Any custom object that is on the master side of a master-detail relationship
  • Any standard object that is on the master side of a master-detail relationship with a custom object
  • Opportunities, using the values of opportunity products related to the opportunity
  • Accounts, using the values of related opportunities
  • Campaigns, using campaign member status or the values of campaign member custom fields

Example: total invoice lines on an invoice

Say Invoice_Line__c is the detail of Invoice__c in a master-detail relationship. You want Invoice__c to show the sum of Invoice_Line__c.Amount__c. Build and test it in a sandbox first (Salesforce Help).

  • Setup > Object Manager > Invoice > Fields & Relationships > New.
  • Select Roll-Up Summary as the data type, then click Next.
  • Label it Total_Lines, and select Invoice Line as the object to summarize.
  • Choose SUM, and pick Amount__c as the field to aggregate.
  • Optionally add a filter, for example only lines where Status__c equals Approved.
  • Set field-level security, add the field to the page layout, and save.
  • Result: Invoice__c.Total_Lines__c shows the total and updates when detail records change.

What limits and rules apply?

Most "why can't I" questions trace back to these rules. The Custom Fields Allowed Per Object page lists 25 roll-up summary fields per object (Salesforce Help). A System Administrator can ask Salesforce Support for more, up to a hard maximum of 40 (Salesforce Help). Salesforce suggests trying reports first, since many roll-ups can slow performance.

After you create a roll-up summary field on an object, you cannot convert that object's master-detail relationship into a lookup (Salesforce Help).

  • A roll-up filter cannot use long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula fields or lookup fields (Salesforce Help).
  • A roll-up cannot reference cross-object formulas, and a formula field works only if it has no functions such as NOW or TODAY (Salesforce Help).
  • A filter on a picklist with many values fails once the values exceed 255 characters in total (Salesforce Help).

What are common roll-up summary mistakes?

Most roll-up problems come from the relationship type or the filter. Each has a fix.

  • Looking for the field on a lookup relationship. Fix: convert to master-detail if the data allows, or use a record-triggered flow.
  • Using a formula with TODAY or a cross-object reference as the field to aggregate. Fix: store the value in a normal field first.
  • Adding filter values in the wrong language. Fix: enter filter values in the org default language.
  • Planning for unlimited roll-ups. Fix: count the roll-ups on the object before you add another, and move heavy ones to reports.

What can you use on a lookup relationship instead?

A lookup relationship gives no roll-up summary fields. If you cannot make the relationship master-detail, a record-triggered flow can count or total child records and write the result to a parent field. Apex can do the same for complex cases. Some Industries products also have Record Rollup Definitions, with their own restrictions (Salesforce Help).

Flows and code are yours to maintain. A roll-up summary field is a standard field type, so when master-detail fits your data model it is the simpler choice. See also record-triggered flows and master-detail relationships.

FAQ: Roll-Up Summary Field in Salesforce

What is a roll-up summary field in Salesforce?

A field on the master record that calculates a value from related detail records: a count, or a sum, minimum or maximum of a detail field.

How many roll-up summary fields can an object have?

25 by default. A System Administrator can ask Salesforce Support to raise it, up to a maximum of 40 per object (Salesforce Help).

Can I create a roll-up summary field on a lookup relationship?

No. Roll-up summary fields work on the master side of a master-detail relationship. For lookups, use a record-triggered flow, Apex or an app.

What are the roll-up summary types?

COUNT, SUM, MIN and MAX.

Can I roll up from a formula field?

Sometimes. The formula must have no cross-object references and no functions such as NOW or TODAY (Salesforce Help).

Can I turn master-detail into lookup after adding a roll-up?

No. After you create a roll-up summary field on an object, you cannot convert that object's master-detail relationship into a lookup.

Getting Started

Try this on your own org

Start the 14-day free trial, no card. Clientell AI asks before it changes anything in production.

14-day free trial  ·  No credit card required

SOC 2
HIPAA
ISO 27001
Salesforce Partner