- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 10:10 PM
Hi Team,
I am unable to hide the mandatory field using UI Policy. Because there is a variable set ,using the same field for 5 different items. can anyone help me
Regards,
Saridha.L
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 06:22 AM
As other suggested UI Policy is good option where you can select the particular catalog item and then based upon variable value changes you can to set the field behavior. You can build the condition. I think when you are selecting the Catalog item then it should not impact other catalog item if they are referring the same variable set.
if there is any issue with UI Policy then give a try with catalog client script if that helps. Simple Sample Script (change the field_name accordingly)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'PUT THE FIELD VALUE HERE'){
g_form.setMandatory('field_name', false);
g_form.setDisplay('field_name', false);
}
else{
g_form.setMandatory('field_name', true);
g_form.setDisplay('field_name', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 06:48 AM
Hi Saridha,
As you made the field as non-mandatory , you should be able to hide it. But since you said another UI policy is also there on the same field , you need to ensure that the logic is not overriding by the other UI policy, which you can manage by order field value.
For any reason, if you still having issues managing your logic with UI policies, you can go for below logic. But remember, handling with UI policies is the best practice and the below client script is advisable only when you cannot directly manage with UI policy.
client script :
g_form.setVisible('field_name_here', false);
Regards
Srinivasa Reddy Neelapu
********************************
Please mark response with a Like, Helpful or Correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 11:36 PM
Hi Srinivas,
Thank you for your response.
As you suggested I have tried, still it didnt work.
Regards,
Saridha.L

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 11:38 PM
Is this in Service Portal or Fulfiller interface?
I've noticed they process order of UI Policies differently under some circumstances.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 11:50 PM
Can you make sure that "Applies on a Catalog Item View" is checked?
If checked, check if there are any other UI Policies running at the same or higher order.
If no UI Policies found, then make the mandatory field false and try hiding the field using UI Policy actions.
If any of these doesn't work, try using Catalog Client Scripts, which is a closer alternate to UI Policies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 12:57 AM
Hi Gowrisankar,
There is an another UI Policy running for the same field.