Search
Close this search box.

Roll-up Summary Fields without Master-Detail Relationships

Red Argyle Logo without name
Red Argyle logo

This post is going to be both a bit shorter and a bit more technical than what I normally post, but a recent discovery of mine is just too cool not to say something about. Last week I was trying to do some roll-up summary fields between two objects in a managed package (specifically, TaskRay Projects and Tasks). I’d assumed that the objects would be in a master-detail relationship. When I found out that they weren’t, I was getting ready to have some code written to move info about the Tasks onto the Projects. This isn’t the first time I’d run across a scenario like this, and an Apex trigger was the only thing I’d ever found that can move information across a lookup relationship like this.

Thankfully, Tom managed to turn me on to a solution for this issue. Andrew Fawcett, CTO of FinancialForce.com and Force.com MVP, has created a package that allows you to set up roll-up summary fields on objects that are only related via lookup, and, even better, it allows you to create these roll-ups declaratively! You can install the managed package into your org by using this link.

Salesforce Roll-up Summary Fields

Once the package is installed, you gain the ability to create Lookup Roll-up Summary objects. These allow you to select two objects that are related via lookup field, designate the field on the top-level object that will have the roll-up data stamped into it, define the type of roll-up operation to execute (like count, average, or otherwise), and even add criteria to which sub-objects are going to be included in the summary.

Now, in all fairness, setting things up with this package isn’t quite as simple as creating a regular roll-up summary field. Even with the “Enhanced Edit” functionality that helps you choose your objects and fields, the only way to apply a filter is to write out your criteria as you would for a SOQL query. Because of that, I’d recommend this solution for more experienced Salesforce Administrators, or at least those who have some solid development knowledge of the system. But these are minor complaints in light of its strengths. It’s a free and open-source package that allows you to solve a problem declaratively that could otherwise only be solved with custom code, and that’s pretty freaking awesome.

I want to offer some epic thanks to Mr. Fawcett for creating this package. And to any other Admins that are looking to solve a similar problem, I highly recommend taking a look at this solution. I’m definitely going to be keeping this one in the toolbelt. If you’ve found a different solution to making roll-up summary fields without master-detail relationships please share them in the comments!

Red Argyle logo
Red Argyle logo

Related Blog Posts