- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 09:50 PM
Hey everyone very good morning
I want to set the multiple choice variable value to true at the onchange catalog client script. I have written script but it's not working please help
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 10:04 PM
Hi,
please try below onchange client script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearValue('request_type');
g_form.setValue ('request_type', 'test2'); //you need to pass variable name and choice value
}
Hope you it helps you.
Please Mark ✅ Correct/helpful if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 10:04 PM
Hi,
please try below onchange client script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearValue('request_type');
g_form.setValue ('request_type', 'test2'); //you need to pass variable name and choice value
}
Hope you it helps you.
Please Mark ✅ Correct/helpful if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar