Skuid Rollup summaries with UI-only formula fields

  • 5
  • Praise
  • Updated 1 year ago
  • (Edited)
I have to give Pat Vachon (mBlazonry) a lot of credit for coming up with this awesome and stupidly easy-to-implement idea!

By adding a UI-only formula field to a parent model and using the syntax below in the UI formula builder...you can calculate and display rollup summaries.

{{CustomObject__r.totalSize}}



Notes:
  • Just be sure to add the child relationship to your model within the model's fields section.
  • No Master-Detail relationship needed (lookups relationships are fine)
  • No third-party app needed like DLRS (declarative rollup summaries) or Rollup Helper
  • Usable directly in a basic model on field editors, tables, templates, page titles...no need to build a separate aggregate model
  • Granted...this is a UI-only field, so the summary isn't saved to the object, but you could easily solve that with an action sequence that would 1) update a SF field with the UI-only value and 2) save down the value
  • Super quick and easy to implement




# of Goals in Progress is a UI-Only Formula Field in a
table with drawers that open up to display the specific goals
Photo of Conlan O'Rourke

Conlan O'Rourke

  • 3,270 Points 3k badge 2x thumb

Posted 2 years ago

  • 5
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Thanks for the kudos Conlan. :)

Just be sure to the child relationship name and the not the object name.

Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Nice!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Also, this is only a count of records, but you can also filter them using the condition.

Additionally, using "Fields to Order Records By" and "Max # of Records (Limit)" set to 1, then one can also achieve Min or Max on Dates and Numbers. 

{{{{Transaction_Line_Items__r.records.0.FIELDCHOICEHERE}}
Photo of Premanuj Gupta

Premanuj Gupta

  • 100 Points 100 badge 2x thumb
How do we Sum a particular field with filter condition. I have an object with an amount field and I need roll up summary - sum of Amount field based on a picklist value.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Premanuj,

You can use an aggregate model to get the sum of Amount by the picklist value.  Then add a Model UI Only field to the model where you want the sum to appear.  Setup this UI Only field as a Formula field and use the Model Lookup feature to find the matching sum for the picklist value.

Thanks,

Bill
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Trying to use Pat's super cool min Date rollup method on the Tasks Child relationship. Any idea why this isn't working as the formula?
{{Tasks__r.records.0.ActivityDate}}
(Edited)
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I figured it out. I had Tasks__r.  The relationship name is clearly Task with no __r.  Once I dropped the __r, it worked like a charm. Thanks Pat and everyone who contributed.