Hide a field in a catalog item view based on requestor's user role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello Everyone,
How can you make a certain field invisible and not mandatory?
There is a UI policy set to where if urgent request is 'Yes'
Need by Date and Approving Deputy Director is mandatory and visible.
But in a catalog item view in the Service Portal, I want to make 'Approving Deputy Director' invisible and not mandatory if the person submitting the form has 'deputy_director' role. How can I achieve this? (I am using Yokohama)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
function onLoad() {
if(g_user.hasRoles("deputy_director") {
g_form.setMandatory("approving_deputy_director", false);
g_form.setVisible("approving_deputy_director", false);
}
else{
g_form.setMandatory("approving_deputy_director", true);
g_form.setVisible("approving_deputy_director", true);
}
}
