Skip UI policy of mandatory fields validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2020 11:25 AM
Hi,
Is there any way I can skip the UI policy of mandatory fields validation for certain UI action? The problem I'm facing now is, when the state changes back to draft (UI action: Reset to Draft), the mandatory fields validation should not take place at all.
I was thinking if I can use BR before rule to skip the UI policy for this specific condition ie. state changes to draft, but I have no idea how should I write it in script.
Appreciate your help. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2020 11:47 AM
As a cheat you can name your UI Action "action name" to sysverb_cancel. This allows the saving of the form and ignore mandatory fields.
Chuck covered this in his UI Action video found below
https://youtu.be/_G8X9bi8spE?t=2504

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2021 09:14 AM
You can try below code on UI action. It will work.
function callClientScript() {
//Client Script
var arr = g_form.getMissingFields();
for (var x = 0; x < arr.length; x++) {
g_form.setMandatory(arr[x], false);
alert("Following fields are set Non Mandatory: " + arr[x]);
}
gsftSubmit(null, g_form.getFormElement(), 'update_to_p1'); // UI action name
}
if (typeof window == 'undefined')
callServerScript();
function serverScript() {
// Server Script
current.update();
action.setRedirectURL(current);
}
Please mark answer helpful if it helped.
Regards
Pawan K Singh