- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday - last edited Tuesday
Hi ,
below scenario was asked in interview -
there is field which is mandatory in dictionary level ..
and you have to make it hidden ..using UI policy
how to do it..?
My usual Ans was
first to make Un mandatory and then we can hide it using client script , seems he was not convinced..
is this correct answer..?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
your approach is correct.
1st make it non-mandatory and then hide
you can use onLoad client script or onLoad ui policy for this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi @tushar_ghadage ,
I tried your problem I think we have to create a client script which runs onLoad and from the script we have to make it mandatory false and display also false.
function onLoad() {
// var annotations = getAnnotations();
g_form.setMandatory('description', false);
g_form.setDisplay("description", false);
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
your approach is correct.
1st make it non-mandatory and then hide
you can use onLoad client script or onLoad ui policy for this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi @tushar_ghadage ,
I tried your problem I think we have to create a client script which runs onLoad and from the script we have to make it mandatory false and display also false.
function onLoad() {
// var annotations = getAnnotations();
g_form.setMandatory('description', false);
g_form.setDisplay("description", false);
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Is the field mandatory from dictionary level...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Yes it is
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
