function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TempleHoffTempleHoff 

Simple Flow to update multiple records

I'm trying to build a simple flow that can be used from a button on an account to find any children of the account and update their Parent Account field.  I can get the Account ID into the flow, and I've create a search field for the user to enter search criteria which drives a Dynamic Multiple Choice checkbox field which displays the list of Accounts that match the criteria.  Now all I want to do is update the parent Account of each account that is selected in the list.  For the life of me, I can only get the first account selected in the list to actually update.  I've tried set a variable equal to the Dynamic Multiple Choice field and I can then see that the record IDs of all the select accounts are added to the field and ; seperated.  But, then the Update function fails because I can set the criteria in the Update function to update where the variable contains the accountid.  Any help on this?  How do you update all the records selected in a Dynamic Multiple Choice field?

DarrellDDarrellD

You really don't do this right now is the basic answer. Visual Workflows are closer to native Workflow in SalesForce right now with what you describe. Just like you cannot update multiple records at same time with a Workflow, can't really do it here either.

 

Now, there are some workarounds where you would iterate through the list. So you might build a dynamic list that includes something like AccountID Not Equals Your Account ID.  Then as each one gets updated the list gets smaller.  I believe there are some other posts here with your same question and the developer, Rajaram, posted a more elegant version of what I describe above.  But you can't do this like a Trigger would work right now. Though I'm sure they are working on that.

 

Darrell

RajaramRajaram
Please take a look at my sample on github. https://github.com/raja-sfdc/FlowProcessMultiSelectChoices. it is a bit of a workaround, but should be sufficient to address your use case.
goravsethgoravseth

Just a note - there is a trailing . at the end of Rajaram's link.  The correct link is:

https://github.com/raja-sfdc/FlowProcessMultiSelectChoices

 

cheers