Not able to hide the Short description field while loading the incident form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everyone,
I have written a client script which is onLoad type and I set short description filed to be hidden and description field to mandatory for incident table but when I load or refresh the Incident form changes are not reflected. Could you please help me how to fix this issue and what could be the reason?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Please check whether this is mandatory at the dictionary level, as that might be the reason. Also, verify which table you are trying to use—you might need to override the dictionary as well.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This issue occurs because ServiceNow does not allow mandatory fields to be hidden. If a field is marked as required, any attempt to hide it will be ignored.
To resolve this, remove or disable the mandatory setting for the field before applying the visibility change in your Client script /ui policy.
1. If you are using Client SCript -> Update OnLoad client script :
function onLoad() {
g_form.setMandatory('short_description', false);
g_form.setDisplay('short_description', false);
g_form.setMandatory('description', true);
}
Else update existing UI policy.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
share script here and client script config screenshots and the outcome screenshots
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader