- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 12:41 AM
Hello,
we have one record producer named as "Report an Issue" , Upon selection of "category" in "report an issue" record producer pop up is coming to display that you are raising issue for "name of the service" service and have a user clickable option "Ok".
Could you please help me on this
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 03:38 AM
Hi,
there is another checkbox on Catalog Client Script:
Applies on Target Record
If you select this checkbox then it would run on the form as well
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 02:12 AM
Hi,
when you use alert box of javascript you can give your text or message there which should come and should be seen to user
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if ( newValue == '') {
return;
}
if(newValue == 'your value')
{
alert('This is my text for alert');
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 02:52 AM
Hi Ankur,
Yes i have tried below code and it is working as expected but this client script should work only for particular record producer and also one thing as shown in below screenshot the sys id is displaying but it should display the name of the service
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//if ( newValue == '') {
//return;
//}
if(newValue != '') // add the category value of your choice
{
var service =g_form.getValue('business_service');
confirm("Your company is " + service +", do you want to continue?");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 03:12 AM
Hi,
For making it work only for your record producer you need to select the catalog item i.e. your record producer in the Catalog Item field during catalog client script creation
Also for getting the name instead of sys_id use this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(newValue != '') // add the category value of your choice
{
var service =g_form.getDisplayBox('business_service').value;
confirm("Your company is " + service +", do you want to continue?");
}
}
Select your record producer in the Catalog Item field
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 03:21 AM
If I create a client script for record producer will the alert msg will appear on the incident form when the category field changes?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 03:31 AM
No it won't .
As you will create catalog client script of record producer and normal client script for incident.