Incident-query(Need to remove mandatory fields while closing the incident)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 05:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:07 PM
Hello @khasim523169 ,
Please give some clarity about it. Do you want to make mandatory false to those fields or you want to delete those fields from form?
If u want to make mandatory false to those fields you can use onChange client script or UI Policies,
g_form.setMandatory('close_code',false);
g_form.setMandatory('close_notes',false);
If u want to delete fields from form, it is not possible to remove field, you can hide those fields using g_form.setVisible('close_code',false) or g_form.setDisplay('close_code',false)
Please mark my answer helpful & correct, if it helps you
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:12 PM
Hi @khasim523169 OOB there are 2 scripts which makes these fields mandatory. You can deactivate the below scripts
- A Data Policy "Make close info mandatory when resolved or closed".
- A Client Script "(BP) Close Mandatory on Close or Resolve" that ensures that resolution code and resolution notes are mandatory onSubmit.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 05:03 AM
May i know why you want to break the foundation validation? Res cat /code is a helpful information, that can help to improve the process.
It is OOTB
You can check the client script.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 05:31 AM
Hello @khasim523169 ,
There is a OOB OnChange Client Script named 'Resolution details visibility on state' which is responsible to make the 'Resolution codes' and 'Resolution notes' mandatory. You can modify this Client script as per your business need.
If above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh.