- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2014 10:55 PM
Hi,
I have a form on user defined table (u_ba_service_package) and created 2 UI Actions "Save" and "Cancel".
I have mandatory fields on the form and on click of "Save" and "Cancel" mandatory fields are validating and getting an alert "The following mandatory fields are not filled in:<field 1>,<field 2> etc.."
but i don't want to validate mandatory fields on Click of "Cancel". it should be happened only when click of "Save".
How can i achieve this? can any one please help me on this?
Thanks,
Pavan.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2014 11:09 PM
Hello Pavan,
You may find the below thread as helpful.
Saving a record without populating all mandatory variables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2021 09:20 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:51 AM
I have the same requirement but mine isn't working as expected. I have two variables I have made mandatory via UI Policy/Action on sctask. However, when the state of the sctask is marked Closed Incomplete, I need the two variables no longer be mandatory once the UI Action button "Update" has been selected.
Here's my script in the UI Action "Update":