0

I have a Master-Detail Relationship. Each Child record has a Name__c field.

I want to create a child_names__c field on Parent that is a sorted-asc csv of of each Child's Name.

Rollup-summary seems to only allow me to operate on Numeric fields and not Text. I can't use a Formula Field either because I can't operate on Children records.

What's the best way to do something like this? A Flow for each time a Child record is modified?

I'd have to recalculate this child_names__c field any time any of the child records are either added,removed,updated. This is because I need to maintain the sorted csv.

In JS, I'd do something like const childNames = Parent.getChildren().map(child => child.name).sort().join(",") any time there's a CRUD operation on a Child.

Any ideas?

2
  • 3
    This can be done in DLRS as it supports a concatenation operator
    – cropredy
    Jan 20, 2022 at 23:13
  • worked like a charm after some trial+error. Pretty self-explanatory plugin too. I can accept this as an answer if you would like. Will have to thoroughly test this to see how performant it is though. I'm upserting 50k+ records once a day and the new rollup-summary will have to be run for any related parent records. Jan 21, 2022 at 19:25

1 Answer 1

1

A cool tool to use for rollups when OOTB roll-up summaries aren't applicable is Declarative Lookup Rollup Summaries (open source).

In addition to working over lookup relationships, it supports expanded summarization operators. For you, the relevant one is concatenation including delimiter configuration.

You'll need to be cognizant of the parent field size (for example, if there were 1000 child rows for a given parent, each with a text field of length 133, then you'd exceed the maximum field size for a text area long field.

DLRS supports real-time rollups as well as scheduled rollups (as a batch).

1
  • "You'll need to be cognizant of the parent field size"..good point. I'm going with Text Long for Parent field to account for this Jan 24, 2022 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .