Cheat Sheet for Declarative Lookup Rollup Summaries

Cheat Sheet for
Declarative Lookup Rollup Summaries

Business Problem

In Salesforce, it’s common to have records connected through lookup relationships. Often, you need to roll up values from related records to a parent—but doing so with standard tools isn't always straightforward.

While roll-up summary fields seem like the obvious choice, they come with several limitations:

  • They only work with master-detail relationships
  • You can't use formula fields, filter logic, or relative dates in the filter criteria
  • There’s a hard limit on how many roll-up summary fields you can create per object

Because of these limitations, we needed a more flexible solution to automate field updates—without writing code.

That’s where Declarative Lookup Rollup Summaries (DLRS) comes in. This free, open-source tool makes it possible to roll up values across lookup relationships and overcome all the above limitations. However, the official documentation can be a bit overwhelming, especially if you're new to Salesforce.

This article will serve as your cheat sheet to install DLRS quickly and get started with confidence.

How to Install Declarative Lookup Rollup Summaries

Go to the Salesforce.org MetaDeploy link for DLRS.

  • Documentation can be found here.
  • 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

Setup Your First Rollup

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

H

  • 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