When users create a document from a form that generate sequence numbers, they hit a button that activate the agent that generate the numbers,The sequence numbers are generated based on teams, each Team must have its own numbers in a sequential way, (therefore cannot use Profile doc as I my teams keeps on Increasing and would require a Design change everytime a team is introduced).
Problem. When the Users the save button at the same time, the agent creates duplicates, meaning failing to synchronise the generation of numbers. How can I tell the agent to wait if the script is busy run by another user and release the lock if the user is finished running the script. Please help.