Cheat Sheet for Declarative Lookup Rollup Summaries

Business Problem

We have records that are related to each other in Salesforce and need to roll up values to the parent record. We tried using roll-up summary fields, but we ran into one of these issues:

    • Our records do not have a master-detail relationship, roll-up summary fields do not work on lookup relationships.
    • Cannot use the following in roll-up summary filters:
        • Formula fields
        • Filter logic
        • Relative dates
    • Reached the roll up summary limit for an object.

We need a different way to automate the update to these fields easily.

We have heard about this amazing, free, open source tool called Declarative Lookup Rollup Summaries, but need a little help figuring out how to install it. The documentation can be a little intimidating for someone new to Salesforce. This article will serve as your cheat sheet to get up and running fast!

How to Install Declarative Lookup Rollup Summaries

  • Click Install Declarative Lookup Rollup Summaries button
DLRS Package Installation1

  • Click Log In to Install
DLRS Package Installation2

  • Click Allow
DLRS Package Installation3

  • Click Install
DLRS Package Installation4

  • When the Installation Progress = 100% Complete, click View Org.
DLRS Package Installation5

Now, we are ready to create our first roll-up! In our example, we want to count the number of closed won Opportunities a Contact is related to. Contacts are related to Opportunities via Opportunity Contact Role records.

  • First you need to create the field that is going to hold the data. We created a number field called # Closed Won Opportunities on the Contact object.
DLRSClosedWonOpps1

  • Go to the 9 dots -> Search for Manage -> Click Manage Lookup Rollup Summaries
QuizAppDRLS1

  • Make sure it says Create new...
QuizAppDRLS2
    • Enter the following information:
      • Lookup Rollup Summary Name: Contact | # of Closed Won Opps
      • Lookup Rollup Summary Unique Name: Contact_Number_of_Closed_Won_Opps
      • Parent Object: Contact
      • Child Object: OpportunityContactRole
      • Relationship Field: ContactId
      • Relationship Criteria (this is the where clause of the SOQL query): Opportunity.IsWon=True
      • Relationship Criteria Fields:
        • Field to Aggregate: Id
        • Aggregate Operation: Count
        • Aggregate Result Field: Closed_Won_Opportunities__c
        • Calculation Mode: Realtime
        • Calculation Sharing Mode: System
      • Then click -> Save

Make sure to leave the Active checkbox set to false if this is your first roll up on the Contact object. You will not be able to save the record if it is true because we have to deploy the trigger first.

DLRSClosedWonOpps2a

  • Click Manage Child Trigger
DLRSClosedWonOpps2b

  • Click Deploy
DLRSClosedWonOpps3

  • Click Cancel -> I know this seems weird but if you click Remove it will uninstall the trigger. Cancel will take you back to the previous screen.
DLRSClosedWonOpps4

  • Click Active checkbox to set it to true
  • Click Save
  • If you have existing records that need to be calculated click Full Calculate. If not, you are all set!
DLRSClosedWonOpps5

For any questions, comments, concerns – let us know in the comment section below!
We would love to hear from you!

Share This Story, Choose Your Platform!

About the Author

Cheryl Fernandes

Cheryl is a certified Salesforce Application Architect and is the Founder and Lead Salesforce Consultant at Blu Ninjas. She has been working with Salesforce for 12 years and has helped companies in financial services, insurance and beauty industries implement solutions on the platform. Flow is her favorite Salesforce declarative tool, it is a game changer for anyone who does not know how to code.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top