- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 06:59 AM
I need to modify the "Request Approval" UI Action to abort if a field is empty when it is clicked. How can I accomplish that? Can't use current.setAbortAction(true) because client side, and returning false does not seem to work either.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 07:05 AM
Hello,
You would add code to not have it execute that actual action, save or submit or whatever you're doing.
Ideally, you'd instead use an if else type solution to branch and let the user know to populate 'x' field.
g_form.addErrorMessage("Message");
This validation could be done at the very top of the code and then the else goes into the actual script if the field is not empty:
if (g_form.getValue('field_name' == '') {
g_form.addErrorMessage("Please fill in a value for x field");
} else {
//do the other code
}
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 07:05 AM
Hello,
You would add code to not have it execute that actual action, save or submit or whatever you're doing.
Ideally, you'd instead use an if else type solution to branch and let the user know to populate 'x' field.
g_form.addErrorMessage("Message");
This validation could be done at the very top of the code and then the else goes into the actual script if the field is not empty:
if (g_form.getValue('field_name' == '') {
g_form.addErrorMessage("Please fill in a value for x field");
} else {
//do the other code
}
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!