You need to sign in to do that
Don't have an account?
Mohsin.Raza
Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []
I have a customer who is reporting the below error when my code creates Task record.
Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []
The whoid for task is usually a contact and whatid is opportunity or case. This is an intermittent issue and is not easily reproducebale. The strange thing is that this occurs when inserting a new task record so we dont know which record is causing this to fail as the task record could not be lock at this point as its not yet created. Can it be that one of the parent records (contact or opportunity) is locked?
Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []
The whoid for task is usually a contact and whatid is opportunity or case. This is an intermittent issue and is not easily reproducebale. The strange thing is that this occurs when inserting a new task record so we dont know which record is causing this to fail as the task record could not be lock at this point as its not yet created. Can it be that one of the parent records (contact or opportunity) is locked?
Hi there is some kind of recussion going on like
1.)Trigger is calling another trigger which is trying to update same record
2.)batch is calling another trigger which is trying to update same record
So just check all your active actions and see if any 2 of them are clashing with each other.
More info : https://salesforce.stackexchange.com/questions/20921/can-anybody-explain-the-unable-to-lock-row-error
Hope This helps,
Please let me know in case of any further assistance.
Thanks
Varaprasad
I will review existing triggers and batch processes.
Thanks,
Mohsin