Client-side concurrency control
As described in the previous recipe, sever-side concurrency control can be enabled when making a server-side UpdateRequest
or DeleteRequest
, however, client-side concurrency is not currently available while using the frontend UI.
In this recipe, we will create a custom JavaScript library that checks for concurrency when saving the record, essentially enabling a client-side optimistic concurrency control mechanism. We will then enable it for the contact entity being used.
Getting ready
In order to build this customization, you will require the System Customizer
or higher security role. End users, however, will only require read/create/update access to the entities.
How to do it...
- Navigate to
Settings
|Solutions
|Packt
. - Click on
Web Resources
and click onNew
, enterpackt_/js/concurrency.js
as the name, selectJScript
fromType
, and then click onText Editor
. - Copy and insert the following piece of code:
var packtNs = packtNs || {}; packtNs.concurrency = packtNs...