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):

RE: How to validate entries by recording record types?

 

Client (function for the button):

RE: How to validate entries by recording record types?

 

Thanks in advance.

noslenpena Rookie Asked on August 19, 2020 in SuiteScript.
Add Comment
2 Answers

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.

Rookie Answered on August 21, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.