jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
210 stars 30 forks source link

Suggestion: allow us to use a field from a related/parent record as the Rollup Field On Child Object #505

Closed solo-1234 closed 6 months ago

solo-1234 commented 11 months ago

Every so often I find a use case for this - to allow us to use a field from a parent object when rolling up junction records to another parent.

For example: Populate a field on Contact with a comma separated list of related Campaigns (via CampaignMember) with specific criteria. The Campaign name (or other field) isn't pulled from the CampaignMember (though a formula field would probably work).

I'm wondering if this is a big deal to add and if others would use it as well.

Thanks!

jamessimone commented 11 months ago

I could see supporting this through another CMDT - which I've considered adding anyway to support things like Task/Event/Case Comment/User - where all of the fields you're filling in are text and dot notation could be allowed for the lookup/rollup fields

solo-1234 commented 11 months ago

That sounds neat!

Meanwhile I created a formula field on Campaign Member. My initial run (using the Rollup app) took a really long time but that might be due to the number of records and not because of the formula field. Either way, this should be good enough for now :)

Thanks!

jamessimone commented 6 months ago

@solo-1234 I am going to close this one for now - especially with #570 now allowing all objects to be rolled up to using CMDT, creating a formula field when you need something to match on from a related record seems a small price to pay. The complexity required to support that kind of lookup within the base package is too high for me to stomach at the moment.