- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi ,
I have below catalog with mentioned select box type variable . I want to show a field message when " add" is selected on that variable . I have tired the below Onchange catalog client script but couldn't get the result .
Please suggest what changes should I make to achieve this ?
Thank You
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Please select UI Type as All.
Also, could you post a screenshot of whole Client script. I guess this is the only issue - UI Type is not selected as all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
onChange is written on which variable?
are you sure you are comparing the correct choice value in your IF condition?
is the choice value as 1 for the choice label Add?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
On change written on request_type field . Yes, the value of the choice is 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
share screenshot of that variable config.
did you try adding alert and see what came in newValue?
try this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
alert(newValue);
if (newValue == '1') {
g_form.showFieldMsg('request_type', "This request requires email approval from the Business mgmt", 'info');
} else {
g_form.hideFieldMsg('request_type', 'true');
}
//Type appropriate comment here, and begin script below
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Tried this but couldn't get the result .