I am using a user event script to validate some fi...
# inventory
v
I am using a user event script to validate some fields on an inventory item after the user hits save. I don't want to throw an error if validation fails because the a throw statement sends an email to the administrator. Instead, I want to take the user to a new page with the validation error displayed and a button that takes the user back to the inventory item. How can I do this?
s
Not too experienced but one option is to use something in
"N/ui/dialog"
to warn them and clear the fields after. Theres probably some form of "do not submit" action as well.
a
Yes, you can use the n/ui/dialog in a client script, or call a suitelet from a client script to perform that validation. I had done the latter for requesting a "rejection reason" populated once upon a time. Not sure you can get line items into such a solution - and even if you could it would seem like overkill.
v
ty