I have a suitelet with a checkbox. I have a client...
# suitescript
s
I have a suitelet with a checkbox. I have a client script that does something based on the checkbox. Let say the box is not checked, then the user check it. The client script does the validation and return an error, I want to undo the check from the box, I did return false but the box stay checked. What is the trick to undo ?
b
Generally returning false in your validateField is the way to go
m
Validate field will validate the field that was changed but it doesn't actually revert the value. If you want to implement that logic you would have to call setValue( ) on the field before returning false
b
in his specific case, its a checkbox that starts unchecked, returning false should work fine for rejecting the checked value.
from his description, im guessing he is not returning false and is throwing an Error instead