RE: How to validate entries by recording record types?
I created a button in a Suitelet form which call a function to save a generated number adding one to the last generated in a custom record type, the button works and it save the new number as it is expected, the problem is when more than one user click the button at the same time to generate a new number, it supposed to give a different number for each one, but it return the same number. How do I validate to give a new number even if the button is clicked by two or more users?
here is part of my code:
Suitelet (button):
Client (function for the button):
Thanks in advance.
Hi, I solve the problem moving the “dialog.alert” after the first “lookupFields” and deleting the other one, in that way always is giving me a new number even if users click the button at the same time.

