Skip to main content

What's the best way with declarative automation to update the records on the other side of a junction object? For instance, if a change is made to an Opportunity, update a field on all Contacts related to that record via an OpportunityContactRole. You can't do this with Process Builder. I also don't believe there is a way to cleanly (i.e., without DML actions within a loop) to get all the IDs of those Contacts in a way that Flow can make a single query for them all. For instance, it would be great if we could query for all OpportunityContactRoles, loop through those and put their Contact IDs in a new collection, then use that collection in a new query for all the Contacts, but that isn't an option, right? Is there a good way, perhaps using one of the #Unofficial Salesforce components (https://unofficialsf.com/flow-resources/)? Would I have to create a string out of the Contact IDs and pass those into apex that can use that in query criteria? At that point I'd probably rather just create an apex trigger instead of trying to hack together multiple technologies.

3 commentaires
0/9000