Overcoming Rollup Summary Limitations in Salesforce with LREngine

Rollup summary fields are a common requirement in Salesforce implementations and app development. Rollups are easy to create on master-detail relationships as they are available as a field type. But on certain limits/situations, developers must write an apex code to roll up the child information for common aggregations like COUNT, SUM, AVG, MAX/MIN, etc. Some of these situations are

The ‘USUAL’ approach to handle this limitation is to either

  • Write trigger on various DML(Create, Update, Delete/Undelete) events on child sobject. These triggers manually aggregated the information via Apex or used SOQL Aggregate queries.

  • Write some batch/scheduled apex to perform this nightly.

I tried solving this problem by creating a small Apex utility called “LREngine.” Complete description and details about it are available here on GitHub: https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries

Update 2020

LREngine is popular and going places

This repo was received well by the community and featured in many Salesforce books, official blogs, newsletters, and much more:


Abhinav Gupta

First Indian Salesforce MVP, rewarded Eight times in a row, has been blogging about Salesforce, Cloud, AI, & Web3 since 2011. Founded 1st Salesforce Dreamin event in India, called “Jaipur Dev Fest”. A seasoned speaker at Dreamforce, Dreamin events, & local meets. Author of many popular GitHub repos featured in official Salesforce blogs, newsletters, and books.

https://abhinav.fyi
Previous
Previous

Slides and recordings from Chennai Salesforce Platform Developer meetup–October !

Next
Next

Take aways from Salesforce Noida Developer Meetup !