Unable to hide a field using UI Policy and Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 08:51 AM
Hi Team,
I am not able to hide a mandatory field using UI Policy and Client script . I am using a below script,
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'Change default group'){
g_form.setMandatory('dl_location',false);
g_form.setDisplay('dl_location', false);
//document.getElementById("dl_location").style.display = "none";
g_form.setMandatory('unix_gp_name',false);
g_form.setDisplay('unix_gp_name', false);
}
else {
g_form.setMandatory('dl_location',true);
g_form.setDisplay('dl_location', true);
g_form.setMandatory('unix_gp_name',true);
g_form.setDisplay('unix_gp_name', true);
}
}
Note: unix_gp_name is also a mandatory field, using the above script I am able to hide it. But I am not able to hide dl.location.
Please help.
Thank you.
Saridha.L
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 09:15 AM
Hi,
Is the field you are trying to Hide is a dictionary mandatory ? If yes, you need to change the field to be mandatory using a ui policy.
thanks,
SD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2018 10:41 PM
Hi ,
The variable is in Variable set, in variable set that field(location_made mandatory.
Regards,
Saridha.L
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 08:11 PM
Hi,
Please check if there is any UI policy exist for same field. UI policy is executed after client script.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2018 09:14 PM
don't use both ways (client script and UI policy) to work on same field for same operation. Just verify the what others have suggested also hope you are doing this in catalog clients scripts/Catalog UI Policy?