- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 08:24 PM
Hello Everyone,
My requirement is on catalog item,
Two variables are there and types select box,
1. Service (Options are: None, Depth and Patch)
2. ALM (Options are: None, MG and LM)
When I select the Patch in Service select box, ALM should set LM and it should be ready only.
Please suggest on this.
@Community Alums
@Dr Atul G- LNG
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 08:44 PM
Hi Vinod,
You can use UI policy in the new Washington DC version.
Please refer screenshots below:
If you do not have Washington DC release, you can utilize client script to achieve the same.
If my answer helped you in any way please mark it as helpful or correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 08:40 PM
You can write onchange catalog client script on service field, please use the sample script below
var selectedService = g_form.getValue('service'); // Get the value of the Service variable
var almField = g_form.getControl('alm'); // Replace 'alm' with the actual field name of your ALM variable
// Check if the selected service is 'Patch'
if (selectedService === 'Patch') {
// Set the ALM field value to 'LM'
g_form.setValue('alm', 'LM');
// Make the ALM field read-only
g_form.setReadOnly('alm', true);
} else {
// If the selected service is not 'Patch', enable the ALM field and reset its value
g_form.setReadOnly('alm', false);
g_form.setValue('alm', ''); // Reset the value to None or any default value you prefer
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 08:44 PM
Hi Vinod,
You can use UI policy in the new Washington DC version.
Please refer screenshots below:
If you do not have Washington DC release, you can utilize client script to achieve the same.
If my answer helped you in any way please mark it as helpful or correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 03:14 AM
Greetings!!
You can do this via client script, and i think it is already provided @Vishwa Pandya19 @Maddysunil
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]
****************************************************************************************************************