Hi All, I want to keep dialog alert on before subm...
# suitescript
g
Hi All, I want to keep dialog alert on before submit,but it is not triggering?
m
client script or user event?
g
User event i have written,but it is not triggering.so i used client script now it is triggered..any alternatives by using user event script
m
you cannot use User Event for validation. If you want to perform validation and stop form submission, you need to use ClientScript with saveRecord and you can perform all of your validations here. If current record does not passes your validation you show user error using N/ui/message with some description and if everything is correct return true. To stop current record from being saved, return false from saveRecord. Check this out to see how to use N/ui/message and this for further reading on saveRecord.
e
A User Event is a server-side script, so it has no UI where a dialog could be rendered.
n
Well said @erictgrubaugh
1
n
You can use User Event for validation but you will have to throw an error and it's ugly, you cannot use UI based modules and methods.
281 Views