We have a list which has number sequence, lets say 10001. I have updated the create new document set aspx page - so when we open the open the page to create a new document set the last sequence is fetched and a field is filled with the number on the page, as soon as the page is saved, the list is updated with a new number - in this case 10002. And then the document set is created with the id 10001. Now the problem is that if multiple users open the page at the same time, same sequence number is fetched and we have a problem, how can we avoid the concurrency issue?
Before saving the document, I would query the list "number sequence" to get the real last number.
PreSaveAction()and then use SP API REST to get the last number and check if fetched number equals the last number in the list, if it doesn't, save that field with the real latest number.
- C#: You can create an item adding event handler to get the last number and check if fetched number equals the last number in the list, if it doesn't, save that field with the real latest number..
If you show the fetched number in the new document aspx page, maybe it would be a good idea to remove that field, because maybe it's not the real last number and can be confusing for users.