0

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?

0

Before saving the document, I would query the list "number sequence" to get the real last number.

  • JavaScript: You can you use the function 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.