Roll up Summary fields in Salesforce

To study the Roll up Summary field of salesforce, lets take example from our previous tutorial series

Note : Roll up summary field can only be defined on the master object.

While your formula fields calculate values using fields within a single record, roll-up summary fields calculate values from a set of related records, such as those in a related list. You can create roll-up summary fields that automatically display a value on a master record based on the values of records in a detail record. These detail records must be directly related to the master through a master-detail relationship.

refer this page, to study more about the roll up fields.

The Roll up Summary field is basically of 4 types:

  1. Count
  2. Sum
  3. Min
  4. Max

As, per our previous sessions on salesforce, lets create roll up field on object Course because this is the Master object.

I want to calculate total income from a course:

Go to App Setup | Create | Objects and click on New field and Select Roll up summary field.

In Step 2, enter the field name and help text etc.

For step 3, you will see below screen,

Salesforce Rollup Summary field
Salesforce Rollup Summary field

In above image, at 1 we have to select the child object, at 2 we have to select the field on which it should calculate.

In our case, Fees paid field is of Formula type which works on currency.

And in section 3 you ca specify weather this roll up summary field include all record or any specific record which comes under the criteria you specified.

So, after creation of Roll up field on Master object final look is shown below:

Salesforce Final look on Roll up summary field
Salesforce Final look on Roll up summary field


  1. hi Jitendra Zaa
    I hava a custom object like students on which field is gender [picklist(male,female)]
    when i created new record Mr/Miss is added to the name.
    when i update the record Mr Mr/Miss Miss is adding to the name by using TRIGGERS in salesforce.
    my requirement is when i create/update the record only Mr/Miss wil be add to the name.
    How can i achieve this one by using Triggers.
    please write the code.

    1. Hi Krishna,
      Please explain ur problem in detail, I cannot write the complete code for you but can give direction.

      1. HI Jithendra,

        The scenario is that when i gave Male it is adding Mr. before the name.

        My requirement is when I change the gender(picklist) from male to female, the Mr has to change as Miss.

        How to get the changes by using the triggers?.

  2. Hi Jitendra,

    Can you help in the answer of following question? When salesforce calculate the value of Rollup summary field?
    1) When the child records updated?
    2) Daily?

    And does it calculate the value of only one parent (where the child record of that parent updated) or calculate the value of all parents?


      1. What about existing records in production? Will the roll up summary calculate the count itself automatically on all parent records? Or do i need to update all childs once to have the numbers calculated on parent

Leave a Reply to Jitendra Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.