I have a flow, shown below, that is supposed to update a field called Last Activity, when a Case Comment is added to a Case.
I have the flow in a sandbox and it runs perfectly.
Once it has been through UAT and is promoted to our production environment, I regularly get errors like this:
"This error occurred: SELF_REFERENCE_FROM_TRIGGER: Object 500Pxxxxxxxxxxxxxxxx is currently in a merge operation, therefore a trigger can not update it"
All the users are doing is adding the Case Comments. The comment is added, but it generates the above error, where 500Pxxxxxxxxxxxxxxxx is the parent Case ID.
Anyone got any suggestions, why I am getting a Merged error?
Thank you in advance.
Tony Chilvers
#Flow
Hello @Tony Chilvers,
You are receiving the error message "Object 500Pxxxxxxxxxxxxxxxx is currently in a merge operation, therefore a trigger can not update it," which indicates that the record is currently under a merge operation when the flow attempts to update.
Now, as this flow works in the sandbox, it fails intermittently in production because of concurrent operations on the Case.
To avoid trying to update the Case while it's still being processed, move the update to an asynchronous path using the Scheduled Paths feature:
1. In your Record-Triggered Flow, click + after Start and choose Scheduled Path
2. Set a delay: e.g., 0 Minutes After the Record is created
3. Add the Update Records logic under this Scheduled Path
I hope this helps to resolve your issue.
Thanks & Regards
Amit Kumar