- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 07:11 AM
Hello Team
I have requirement on catalog item to show error message on multiple choice variable based on other variable.
When I select the "call meeting check box" and select the "select" choice in the multiple choice error has to display on multiple choice variable like "when call meeting selected select should not be select"
Please find below screen shots for more details.
Check Box:
Multiple Choice :
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 08:42 AM - edited 12-08-2022 08:43 AM
Okay,
Deactivate Catalog client script and
In that case go with catalog UI policy as below :-
You can add OR condition if you want to add more conditions in below tab
Script :-
Execute if true :-
function onCondition() {
g_form.showFieldMsg('please_select_the_choice', 'when call meeting selected select should not be select', 'error');
}
Execute if false
function onCondition() {
g_form.hideFieldMsg('please_select_the_choice', true);
}
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 07:57 AM
Hi @vinod9 ,
You can create OnChange Catalog Client script as below
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 'true') {
g_form.showFieldMsg('please_select_the_choice', 'when call meeting selected select should not be select', 'error');
} else {
g_form.hideFieldMsg('please_select_the_choice', true);
}
}
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 08:30 AM
Hello @Gunjan Kiratkar
Let me first thank you for your help!
when I select call meeting(check box) and support(Multiple choice) then error has to display on "please select the choice"(Multiple choice variable).
I used your above code, after selecting " call meeting" it is showing error and hiding all the multiple choice values as shown below
Expected behavior is, when I select "call meeting" and "select" then it has to show error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 08:39 AM
*select means support value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 08:42 AM - edited 12-08-2022 08:43 AM
Okay,
Deactivate Catalog client script and
In that case go with catalog UI policy as below :-
You can add OR condition if you want to add more conditions in below tab
Script :-
Execute if true :-
function onCondition() {
g_form.showFieldMsg('please_select_the_choice', 'when call meeting selected select should not be select', 'error');
}
Execute if false
function onCondition() {
g_form.hideFieldMsg('please_select_the_choice', true);
}