Optimistic concurrency control is one of the top asks for enterprise-scale users of Dynamics 365. The moment multiple users have the potential to update records concurrently, concurrency control becomes important. After all, concurrent usage is one of the main reasons why organizations moved away from tracking their work in spreadsheets.
Optimistic concurrency control is the mechanism of detecting concurrent changes when a user tries to update a record that has already been updated since the last time it was loaded. This is opposed to pessimistic concurrency control, where records are locked when read to stop other users from accessing them. Locking can sometimes lead to deadlocks.
At the time of writing, Dynamics 365 only offers server-side optimistic concurrency control. In this recipe, we will demonstrate how to enable optimistic concurrency control when updating a record.
...