- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 07:12 AM
In Change Request form how to make service offering field mandatory When a user selects a Service in the "Service" field that belong to Business Service or Technical Service CI class
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 08:13 AM
Make sure you added the table first in UI policy
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
‎06-05-2025 07:25 AM - edited ‎06-05-2025 07:34 AM
One way is to create a client script that runs onChange for the 'Service' field. In the script section, add something like
var srvc = g_form.getValue('business_service.sys_class_name');
if (srvc == [sys_id of Business Service] || srvc = [sys_id of Technical Service CI class]) {
g_form.setMandatory("service_offering", true);
}
I'll try testing soon. see if the dot-walk logic works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 07:32 AM
Hi @Piyush Dwivedi ,
Create an onChange Client Script on the "Service" field:
- This script will trigger when a user selects a service.
Use GlideAjax to call a Script Include:
- The Script Include will check the class of the selected CI (Configuration Item).
- It should return true if the CI is a Business Service or Technical Service.
Based on the result, set the Service Offering field as mandatory or not.
Mark this as helpful and correct if this helpful.
Thanks,
Yaswanth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 07:34 AM
You can try teh UI policy by dot walk:
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
‎06-05-2025 07:41 AM
In UI Policy for Change Request Form can we filter a condition with Class?