Save form and bypass required fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 07:42 AM
Hello,
I would like to bypass a required field when the "approve" UI Action is clicked. If I save the form and then select approve, some fields are required for approval. If I attempt to save the form after selecting approve, the field becomes required to save the form. Is there a way to bypass the required field at this point?
This is after clicking approve...If I attempt to save at this point, this field is required. I would like to bypass the required field to save the form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 09:00 AM
@Andre8 You can bypass the mandatory fields using Javascript Executor this is a javascript console exclusively available for users with admin role, they can run the javascript on the fly on a form and can make fields on the form non-mandatory.
Here is how I made Caller field non mandatory on incident form.
1. Login as an admin, navigate to the form where you would like to make a field non mandatory press "Alt+Ctrl+Shift+J" on windows or "CTRL+Option+Shift+J" on Mac.
2. Javascript executor will appear like following.
2. Add a script to make field non mandatory
g_form.setMandatory('caller_id',false);
Click on Run my code button to execute this javascript.
3. Once this script runs, the field will become non-mandatory and you will be able to save the form.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 09:10 AM
"On the fly" will not work in this situation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 10:47 AM
Hi Andre8,
You script is not complete, where are 'wgh' and 'st' initialized? Having the complete context will help us here provide assistance.