We have a master detail relation from custom Invoice object to Account. There are bunch of roll-up summary fields on account calculated from invoice.
Other than roll up no where we have logic in triggers/ config where update of invoice record updates account record.
Issue: Lets say I have 2 accounts; A1 (Related invoice records: I1, I2, i3, I4) and A2 (Related invoice records: I5, I6, i7, I8). There is a nightly batch which grabs all invoice records (more than 1 million) and copies a formula field on invoice record to a static field on invoice itself.
Formula field on invoice record : Today() - CreatedDate
Once the batch runs nightly, we are getting this error.
getMessage=unable to obtain exclusive access to this record or 83 records:
What I am assuming is when invoice record I4 is updated, rollup on Account record A1 are updated and when I3 is updated, system is not getting exclusive access on the parent record as it is the parent account records that are getting locked
Is my assumption correct? If yes/ no, can someone point me in right direction.