For the new values to be added in my list, I have put a column which identifies it's serial number(lets say SRNo).
When a row is created, I manually put "New" keyword in that particular field(not any Id yet).
I Have created a workflow that runs after Item is created in that list.
Here is what workflow does:
- It checks weather the record has the "SrNo" value set to "New".
- It then access the another list where I have stored count value for SRNo.
- It updates SRNo by SRNo + 1 It Replaces the "SrNo" field in both the lists.
This seems fine to update SRNo automatically whenever new record is added. But, the problem I face is when this happen in parallel, it creates duplicates.
There have been cases where two user have added Items at same time and the workflow assigned same SRNo to both of them.
Is there any mechanism where only one instance of workflow works at a time? Is there any way avoid the situation?