Hi,
I am looking for an auto-generation code to use in application. at present i have created a doc for holding auto-generated number but some time it allocates duplicate number to multiple documents if one or more user press the button same time. Please advice upon.
Thanks
Subject: Auto-Generation Numbers
There is no simple solution for this in plain Notes. You are probably making automatic numbers either by @dbcolumn or by profile documents.
you can avoid this problem 99,9% if you save the document as soon as the user has created the document (postopen)
If two users have got the same number, the can now have the same number. Now you make some code again at the querySave event checking up on only new document (those two users). Now the two users will only have the same number if they create the document exactly at the same time at saves the document at the same time.
If you want to be 100% sure you can run a script agent ‘when documents have been created or modified’ to check up on these numbers…
Takes a while, but I have used this some times for heavy used databases without having a dublet number for 2 years.
Good luck
ZoomTek.dk
http://www.zoomtek.dk/gb.html