Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM Web API and Row locking during update #93

Open
twiga2013 opened this issue Jan 10, 2020 · 4 comments
Open

CRM Web API and Row locking during update #93

twiga2013 opened this issue Jan 10, 2020 · 4 comments

Comments

@twiga2013
Copy link

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

@davidyack
Copy link
Owner

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

@davidyack
Copy link
Owner

I should add we don't current expose a change set method from this wrapper

@twiga2013
Copy link
Author

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.

@mohsinonxrm
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants