Xrm.Tools.CRMWebAPI
Xrm.Tools.CRMWebAPI copied to clipboard
CRM Web API and Row locking during update
Hi,
How do you go about adding a row lock when updating an entity field using CRM Web API?
Any guidance would be appreciated. Thanks
CDS doesn't provide explicit row locking , it is done implicitly when records are updated - what re you trying to do - the Web API can do a transaction which all request either succeed or fail and organization API can do that via execute transaction. You can also do that via Power Automate ChangeSet action in a flow
I should add we don't current expose a change set method from this wrapper
I have an inventory count requirement where users will be reserving a seat. I want to make sure all the users who are trying to reserve an inventory count cannot exceed the total inventory count. I have a scenario where multiple users are trying to reserve the same inventory at the same time. I want to make sure just one user can get the last inventory count. We are currently using stored procedures to put a database row lock on the table and decreasing the inventory count on a field on a table.
@twiga2013 , were you able to resolve this? what did you ended up doing? You could potentially use a queue to order the reservation requests and then process them in order.