- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2020 08:27 AM
Hi All
I am trying to tweak the UI action ->Workspace Client Script below
with either g_form.checkMandatory = false;
or
for (var i = 0; i < g_form.elements.length; i++)
{
var el = g_form.elements[i];
var fieldName = el.fieldName;
g_form.setMandatory(fieldName, false);
}
to make the mandatory fields on the form not mandatory so that on button click the new form opens. The below works when all mandatory fields are completed but I need it to work when the mandatory fields are still unanswered.
Any suggestions greatly appreciated. Thanks!
===================================
function onClick() {
var result = g_form.submit('sysverb_ws_save');
if (!result) {
//failed form submission
return;
}
result.then(function() {
var params ={};
params.sysparm_parent_table = "xxxxxxxxx";
params.sysparm_parent_sys_id = g_form.getUniqueValue();
g_service_catalog.openCatalogItem('xxxxxxx', '-1', params);
});
}
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2020 05:34 AM
Solved it with using g_form.getFieldValues.... instead of
g_form.elements.length;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2020 09:04 AM
Then there might be some fields made mandatory on dictionary level that's why its not allowing you to make them non-mandat..
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2020 01:12 AM
Hi Muhammad, I double check there are no dictionary level mandatory fields at all. All fields are made mandatory with UI policy on the form only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2020 05:34 AM
Solved it with using g_form.getFieldValues.... instead of
g_form.elements.length;