• Stephanie Kellish
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
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?
In our scheduled daily flow, which runs every morning, we fairly regularly get an error that the parent object ("Parent") of the object the flow is running on and updating ("Child") causes an UNABLE_TO_LOCK_ROW error, specifically referencing that Parent records are being locked multiple times and throwing an error. This seems to be because Child records that have the same parent are running/updating in parallel, in different batches, which causes the lock on the parent to be tripped twice (causing the error). There are no conflicting Apex jobs or other scheduled flows scheduled anywhere near this time period, and it is scheduled at a time where we do not have employees working.

I would like to know if there is any way to either
1) run the batches in a scheduled Flow serially, instead of in parallel, or
2) ensure that all child records with the same parent record are included in the same batch, so that the lock does not get placed twice and cause an error.
In our scheduled daily flow, which runs every morning, we fairly regularly get an error that the parent object ("Parent") of the object the flow is running on and updating ("Child") causes an UNABLE_TO_LOCK_ROW error, specifically referencing that Parent records are being locked multiple times and throwing an error. This seems to be because Child records that have the same parent are running/updating in parallel, in different batches, which causes the lock on the parent to be tripped twice (causing the error). There are no conflicting Apex jobs or other scheduled flows scheduled anywhere near this time period, and it is scheduled at a time where we do not have employees working.

I would like to know if there is any way to either
1) run the batches in a scheduled Flow serially, instead of in parallel, or
2) ensure that all child records with the same parent record are included in the same batch, so that the lock does not get placed twice and cause an 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?
In our scheduled daily flow, which runs every morning, we fairly regularly get an error that the parent object ("Parent") of the object the flow is running on and updating ("Child") causes an UNABLE_TO_LOCK_ROW error, specifically referencing that Parent records are being locked multiple times and throwing an error. This seems to be because Child records that have the same parent are running/updating in parallel, in different batches, which causes the lock on the parent to be tripped twice (causing the error). There are no conflicting Apex jobs or other scheduled flows scheduled anywhere near this time period, and it is scheduled at a time where we do not have employees working.

I would like to know if there is any way to either
1) run the batches in a scheduled Flow serially, instead of in parallel, or
2) ensure that all child records with the same parent record are included in the same batch, so that the lock does not get placed twice and cause an error.