Roll-Up-Summary-Fields-in-Salesforce

Roll-up summary fields are used to calculate a value from related records and display it on a Master Record. The Roll-up field automatically looks for the change in related records and automatically updates the Master record. This can be created only when the relationship between Parent and child is ‘Master-Detail’ Relation.  For Example, we have ‘Quote’ object, which his having a ‘Quote Line Item’ as Child Object. We can calculate the number of child objects exists for the ‘Quote’ and display them in the ‘Quote’ object. When a new ‘Quote Line Item’ is added, the roll-up summary field in ‘Quote’ is updated automatically.

Now, I will be creating a ‘Roll-up’ summary field in Quote object to count the number of line items created for that.

Below are the steps to be followed to create a Roll-up Summary Field in Salesforce:

Are you ready to try our

Salesforce integration?

Steps to Create a Roll-Up Summary Field:

  • Navigate to Setup -> Build -> Customize -> Quotes -> Fields and click on New. Below screen will be shownRoll-up-summary-fields-in-Salesforce
  • Select ‘Roll-Up Summary’ and click on Next button. You will be navigated to below screen, where you have to provide the ‘Field Name’ and ‘Description’. Here I am providing Name as ‘Count’

enter-details-for-roll-up-summary-field

  • Click on Next button. You will be navigated to below screen

define-summary-calculation-and-select-roll-up-type-in-salesforce

  • Now, select the object which needs to be summarized. Here, I am summarizing ‘Quote Line Items’.
  • Select the ‘Roll-up’ type. There are 4 types of Roll-Up:
  1. Count: It counts the number of child records existing for the parent record.
  2. Sum: When ‘Sum’ is selected, you have to provide ‘Field to Aggregate’. It contains the list of numeric fields in the Child object. Sum of all the line items will be calculated and it’ll be updated in the roll-up field.
  3. Min: It returns the Minimum value of a given field in all the child records
  4. Max: It returns the Maximum value of a given field in all the child records

Connect-Salesforce-ERP

  • Here, I am selecting ‘Count’. We can also select particular records based on certain criteria based on our business requirement.
  • I want to include all the records so, I have selected the first option.
  • When we select ‘SUM’ or ‘MIN’ or ‘MAX’, we need to provide the ‘Field to Aggregate’, It is a picklist with the list of fields available on Child Record which can be used to perform the selected operation.
  • The field types that are supported by ‘SUM’ are Percent, Number and Currency.
  • The field types that are supported by ‘Min’ and ‘Max’ Percent, Number, Currency, Date and Date/Time.
  • Select the ‘Field to Aggregate’ in case of Sum, Min or Max and click on ‘Next’ button. You will be navigated to below screen.Roll-up-summary-fields-in-Salesforce-Establish-Field-Level-Security
  • Set the field-level security to determine whether the field should be visible for specific profiles, and click Next. You will be navigated to below screen.Roll-up-summary-fields-in-Salesforce-Page-Layouts
  • Click on ‘Save’ button. Now, the Roll-up summary field is created on ‘Quote’.
  • Navigate to ‘Quote’. There you can find the ‘Count’ field which returns the count of Child records existing for a particular ‘Quote’ Master record.

Are you ready to try our

Salesforce integration?
  • Below screen shows the number of child records existing for the ‘Quote’ Master record.Roll-up-summary-fields-in-Salesforce-Quote-Detail
  • In the above screen, ‘Count’ in Quote is ‘3’ and the number of quote line items are 3.
  • In this way, we can create a ‘Roll-up’ summary field on a Parent record to calculate Count, Sum, Min or Max of child records without writing any code.

Limitations on Roll-Up Summary Fields in Salesforce:

  • A Roll-up summary can be created only on records which are having Master-Detail Relationship
  • Only 25 roll-up summary fields can be created for an object
  • Long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula fields, and lookup fields can’t be used in roll-up summary filters
  • A Master-detail relationship can’t be changed to lookup relationship after creating a roll-up summary field on an object
  • When you refer to a roll-up summary field in a list view or report, you can’t use certain qualifiers, including: Starts with Contains, Does not contain, Includes, Excludes and Within.

Are you ready to try our

Salesforce integration?

Now, you can easily integrate your Salesforce CRM with the back-end ERP system to automate the business process!Connect-Salesforce-ERP