[SalesForce] Salesforce Parent Locking ‘UNABLE TO LOCK ROW’

Does salesforce lock Account Record when user try to update/create following child objects –

  1. AccountTeamMember

  2. Opportunity Line Item (Does sfdc lock opportunity here as well?)

  3. Task

  4. Contact

  5. OpportunityTeamMember (Does sfdc lock opportunity here as well?)

Is this applicable to only Master Detail relationships ? (Not Lookups)

Best Answer

This applies to lookup fields as well as master detail fields - check out the Lookup Skew section of this blog post:

http://blogs.developerforce.com/engineering/2013/04/managing-lookup-skew-to-avoid-record-lock-exceptions.html

The key statement is:

Every time a record is inserted or updated, Salesforce must lock the target records that are selected for each lookup field; this practice ensures that, when when the data is committed to the database, its integrity is maintained.

Related Topic