- 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-26-2020 03:39 AM
Hi,
If it is the alert box you won't know whether user clicked on OK or Cancel
So you can use confirm box and based on what user clicked OK or Cancel stop form submission
var val = confirm('My message');
if(val == true){
return true;
}
else{
return false;
}
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-26-2020 03:47 AM
Hello,
Thanks for your fast reply,
i have used confirm box only
the above script is for catalog client script for onsubmit ?
can you please confirm this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 02:53 AM
Hi mr
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?");
}
}