I have 3 objects with the below relationship:
- One Account(Master) Opportunity(Detail)
- Custom__c(Parent) (lookup on opportunity) Opportunity(Child)
Here's the scenario:
I have 1 Account A
Account A has children Opportunities: O1, O2, O3,...
O1, O2, O3 are child of Custom__c records C1,C2,C3 respectively.
I have a process builder on Custom__c which updates the related Opportunity.
When C1,C2,C3 are updated by their owners at the same time, it's like the owners are competing the access to the master Account record. And I kept getting error message of process builder : "unable to obtain exclusive access to this record or 1 records: ID of Master record},"
The relationship was designed by someone else. So I can't change.
The user experience is bad, how can I allow the users editing the records at the same time without receiving errors?
- Here I'm using a Process Builder, so I can't use "FOR UPDATE".
- My Process Builder is built upon "Custom__c" object which means if I turn the Process Builder into a trigger on Custom__c, my query would be on Opportunity object.
I will be using a query like this:
select Last_Submit_Date__c from Opportunity where id in : *** FOR UPDATE.
Would this query LOCK the parent record when it's a master-detail relationship?