How to Create Roll-Up Summary Field in Salesforce

In the Salesforce tutorial, I will explain how to create a roll-up summary field in Salesforce lightning and Salesforce classic step by step.

A roll-up summary field can be used to summarize the data of all the child records and display the information on the master record.

Let’s take an example to imagine there are two objects. Object A and the Object B and these two objects are related to each other in which A is on one side of the relationship and B is on the many sides of the relationship.

The multiple B records are associated with single A records. In that case, we summarize the field value on all the child records and display that field value on the master record in that situation we create a roll-up summary field.

  • What is a roll-up summary field in Salesforce?
  • How many types of roll-up summary fields can be created in Salesforce
  • How to create a roll-up summary field in Salesforce
  • How to create a roll-up summary field in Salesforce lightning
  • How to create a roll-up summary field in Salesforce Classic

What is a roll-up summary field in Salesforce?

In Salesforce the roll-up summary field is a kind of a reverse of a cross-object formula. In the roll-up summary, we get the records on a child object instead of getting from the parent object after getting the records on the child object store and recalculate this data value anywhere any record on the detail record is saved.

The roll-up summary automatically shows the output on the master records while summing up data from a set of related detail records.

So, with this, we have learned about what is a roll-up summary field in Salesforce.

How many types of roll-up summary fields can be created in Salesforce

There are two types of roll-up summary fields in Salesforce that can be created:

  • Roll-up Summary field
  • Formula field with a roll-up summary

The roll-up summary field in Salesforce is used to calculate the sum, minimum, maximum, or count of child records.

  • Sum operation is used as a sum of a field value on a child record.
  • Maximum operation is used as a maximum of a field value on a child record.
  • Minimum operation is used as a minimum of a field value on a child record.
  • Count operation is used as a count of child records on master records.

A formula field with a roll-up summary in Salesforce is used to calculate a value from the data in a roll-up summary field.

This is how we can understand how many types of roll-up summary fields can be created in Salesforce.

Read: How to Access Developer Console in Salesforce

How to create a roll-up summary field in Salesforce

Here we will discuss the tips for creating the roll-up summary field in Salesforce:

  • The roll-up summary field can be created in an object which is mentioned with a master-detail relationship field.
  • In Salesforce it can only be created for master-detailed relationships and it can’t be created for lookup relationships.
  • In the Roll-up summary field, auto numbers are not available.
  • It is used to copy the data from the child object.
  • We have the field that we recommended in the roll-up summary field we can not change its field type.
  • For mapping lead fields of converted fields the roll-up summary fields are not available.

In this way, we have learned how to create a roll-up summary field in Salesforce.

Read: How to Find Salesforce Org ID

How to create a roll-up summary field in Salesforce lightning

Here we create a roll-up summary in Salesforce lightning. If you want to learn how to create a roll-up summary in salesforce lightning follow these steps:

Step-1: Go to the gear icon(⚙️), under the gear icon there is a setup option. Click on the Setup and then click on the object manager.

How to create rollup summary filed in salesforce
How to create a roll-up summary filed in salesforce

Step-2: After clicking on the object manager, the object manager page is open. Under the object manager, lots of objects are present click on the opportunity object.

How to create rollup summary field in salesforce lightning
Click on the object

Step-3: After selecting the opportunity object, select the field and relationship option that is present in the left sidebar.

Create rollup summary in Salesforce
Click on the field and relationship

Step-4: After clicking on the field and relationship, the field and relationship page is open. Click on the new option.

Create rollup summary in salesforce lightning
Click on the new option

Step-5: After clicking on the new button, the new custom page is open under this page data type is present click on the roll-up summary data type and click on the next option.

Salesforce create rollup summary field in Salesforce
Select the roll-up summary

Step-6: After selecting the rollup summary data type, enter the details that are present. Firstly fill the field label. Here we are filling the field label as Total Product and then fill the field name and then clicking on the next option.

Salesforce lightning create rollup summary field in Salesforce
Fill the information

Step-7: After filling the information now select the object to summarize. Here we select the opportunity product and then select the roll-up type as count and then filter the criteria after that click on the next option.

Salesforce create rollup summary field
Select the rollup type

Step-8: After selecting the roll-up type now established the field level security and then click on the next option.

Salesforce lightning create rollup summary field
Established field level security

Step-9: After establishing the field level security the roll-up summary field is created click on save. After clicking on the saving button the total product field is shown in the field and relationship item.

Salesforce create rollup summary
Total product Field is created

Step-10: After clicking on the save option, go to the app launcher and enter the sales in the search box and select the object that is present in the nav bar. Here we are selecting the Opportunity.

After selecting the object, the object page is open where the record is present click on that record. Here we are selecting Card Item Detail and then clicking on the details.

After clicking on the card item detail the roll-up summary field is created. The total product field is the roll-up summary field which counts the total products that are present inside the cart item detail.

Salesforce lightning rollup summary field is created
The rollup summary field is created

Read: How to Create Public Groups in Salesforce

How to create a roll-up summary field in Salesforce Classic

Here we create a roll-up summary in Salesforce classic. If you want to learn how to create a roll-up summary in salesforce classic follow these steps:

Step-1: Go to the Setup that is present beside the help and salesforce user name option.

How to create a roll up summary field in salesforce classic
How to create a roll-up summary field in salesforce classic

Step-2: After clicking on the setup option, scroll to the bottom of the page there is a create option that is present in the left sidebar click on the dropdown arrow of the create option. Under the create option the objects option is present click on the objects.

Create rollup summary field in salesforce classic
Click on the objects option

Step-3: After clicking on the object option select the USA Student object which is the parent object.

Salesforce classic rollup summary field
Select the object

Step-4: After selecting the USA Student object, scroll to the bottom of the page the fields and relationship option is present. Click on the new option and choose the field type. Here we are selecting the roll-up summary data type and then click on the next option.

Create roll up summary field in salesforce classic
Select the roll-up summary data type

Step-5: After selecting the roll-up summary data type, enter the details that are present. Firstly fill the field label. Here we are filling the field label as Sum of USA Student in the group and then filling the field name and then clicking on the next option.

Salesforce create a rollup summary field
Fill the complete information

Step-6: After filling the information now select the object to summarize. Here we select the USA student in groups product and then select the roll-up type as MIN and then select the field to aggregate as the Created date after that filter the criteria and click on the next option.

Salesforce classic create a rollup summary field
Select the roll-up type

Step-7: After selecting the roll-up type now established the field level security and then click on the next option.

Salesforce classic create roll up summary field
Click on the next option

Step-8: After establishing the field level security the roll-up summary field is created click on save.

Create roll up summary field in salesforce
Click on the save option

Step-9: After clicking on the saving button the Sum of USA Student in the group field is shown in the field and relationship item.

Salesforce rollup summary field is created
Salesforce rollup summary field is created

So, with this, we have learned how to create a roll-up summary field in salesforce classic.

You may also like to read the following Salesforce tutorials.

Conclusion

In this Salesforce tutorial, we have learned how to create a roll-up summary field in salesforce. This can be performed on both salesforce lightning and salesforce classic.

  • What is a roll-up summary field in Salesforce?
  • How many types of roll-up summary fields can be created in Salesforce
  • How to create a roll-up summary field in Salesforce
  • How to create a roll-up summary field in Salesforce lightning
  • How to create a roll-up summary field in Salesforce Classic