I am trying to do an upsert using Database.Upsert() and getting this error:
"caused by: System.DmlException: Upsert failed. First exception on row 200; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 13 records:"
Normally, the code works fine, but on occasion I get the above error.
I know in SOQL statements you can use "FOR UPDATE", but I am doing Database.Upsert(). Is there anything that can be done to solve for this error?
of records.
– user1669296 Oct 27 '20 at 22:59