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
- Click Log In to Install
- Click Allow
- Click Install
- When the Installation Progress = 100% Complete, click View Org.
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.
- Go to the 9 dots -> Search for Manage -> Click Manage Lookup Rollup Summaries
- Make sure it says Create new...
-
- 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
- Enter the following information:
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.
H
- Click Manage Child Trigger
- Click Deploy
- 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.
- 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!
For any questions, comments, concerns – let us know in the comment section below!
We would love to hear from you!