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
Stephanie KellishStephanie Kellish 

How to Sort Scheduled Flows (to prevent row locking error)

I have a daily scheduled flow of a Child record that updates a field on the Child record. Because of SF rules, this scheduled flow also locks the Parent record, which can cause errors if there are multiple Child records that are running in the same flow interview but a different batch.

I am not seeing a way to sort the scheduled flow Record variable so that it is ordered by parent record ID (which would decrease the likelihood of this error). Is there a way to do this?
ShirishaShirisha (Salesforce Developers) 
Hi Stephanie,

Greetings!

Unfortunately,there is no other way to sort the processes but,I would suggest you to manage your record updates with the scheduled flow to avoid the lock issues.

Also,please check the schedule flow considerations in the below doc:

https://help.salesforce.com/articleView?id=flow_considerations_trigger_schedule.htm&type=5

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Stephanie KellishStephanie Kellish
Thanks Shirisha - what exactly do you mean by "manage your record updates with the scheduled flow to avoid the lock issues?"