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.

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.

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

Step-4: After clicking on the field and relationship, the field and relationship page is open. 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.

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.

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.

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

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.

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.

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.

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.

Step-3: After clicking on the object option select the USA Student object which is the parent 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.

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.

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.

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

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

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.

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.
- How to Create Records in Salesforce
- How to Create Record Type in Salesforce
- How to delete schema builder in salesforce
- How to Create Lookup Filter in Salesforce
- How to Create Field Update Using Workflow rule in Salesforce
- How to add Formula Field in Salesforce Report
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
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.