I have a list : Issues. I'am generating the IDs based upon the departments. There are 4 departments: FIN, IT, MFG, HR.
the ID format is
MFG001,MFG002...and so on.
The logic I used here is getting the previous Issue ID based upon the Department and increment it(written in PreSaveAction).
It works fine if 1 item for a particular department is added at a time. The problem arises when multiple users add item pertaining to a particular Department at same time. In that case all the newly created items will get the same ID.
How can I generate unique IDs in this case? Please help me with this.