Roll-Up Summary Field in Salesforce

While working as a Salesforce Administrator, I was assigned the task of calculating the sum of the amount fields from all related child records and displaying that total sum on the parent record. We can use a formula to calculate it, but the rollup summary field makes it very easy.

In this Salesforce tutorial, we will learn about the roll-up summary field in Salesforce. In that, we will discuss the following points:

  • What is the roll-up summary field in Salesforce?
  • Limitations of rollup summary field in Salesforce.
  • Example 1- Create a roll-up summary field in Salesforce.
  • Example 2- Create a roll-up summary field using filter criteria in Salesforce.
  • Example 3- Create a roll-up summary field using MIN type in Salesforce.

What is the Roll-Up Summary Field in Salesforce?

In Salesforce, the rollup summary field is used to aggregate or summarize the data of related child records and display that data on the parent record in a master-detail relationship.

  • We can create a rollup summary field only when two standard or custom objects are in the master-detailed relationship.
  • We can create the rollup summary field on the parent or master side only.
  • The roll-up summary field is read-only. We cannot edit or modify it.

There are Four Roll-Up Types in Salesforce

The following roll-up types are used as functions in the roll-up summary field. These functions calculate data automatically and display it on the parent object.

  1. COUNT: This function counts the total number of related child records and displays them on the parent object in the rollup summary field.
  2. SUM: This function calculates the sum of the fields from all related child records.
  3. MIN: This function displays the minimum value from the related child record on the parent record.
  4. MAX: This function displays the maximum value from the related child record on the parent record.

Note: We don’t need to select a particular field while using the count function. However, the other three functions perform on a particular field.

Limitations of Roll-Up Summary Field in Salesforce

Following are the limitations of the rollup summary field in Salesforce.

  • In the roll-up summary, we can perform only four types of operations.
  • Then, we cannot create a rollup summary field on the lookup relationship.
  • Then, for the SUM, MIN, and MAX operations, we can use only certain fields, such as number, currency, and percentage fields.
  • There is a limit to creating a rollup summary per object. We can create only 25 rollup summary fields, but it can vary depending on the Salesforce edition.

Example 1- Create a Roll-Up Summary Field in Salesforce

For example, I was working on an account and opportunity object, and I was assigned the task of calculating the number of records related to a particular parent record on the account.

  • So here, to calculate the child record, the simplest way is to use the roll-up summary field on the parent(account) object.

We can create a rollup summary field in Salesforce using the following steps.

1. Click on the Gare