- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 06:57 AM
Hi Team ,
I have a requirement that whenever an enduser select a combination of values in Impact and urgency field in service portal,there should be an alert popup stating "This is a high priority issue and will be fixed asap " in bold red text.
For example if an enduser select "All users facing issue " in Impact and "Complete outage" in urgency field,then the above popup alert should appear in the portal.
Any idea how to achieve this?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 11:15 AM
You will need to create 2 catalog client scripts; one of them should run onChange of the urgency field, and one should run onChange of the impact field.
The script below will check the value of both fields and if they match the values in the script it will show the modal.
So copy the code below into the 2 catalog client scripts.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// Get the value of impact and urgency
var impact = g_form.getValue('impact');
var urgency = g_form.getValue('urgency');
var html = '<font color="red" size="4"><p><strong>This is a high priority issue and will be fixed asap</p></strong></font>';
// If impact and urgency
if (impact == 'All users facing issue' && urgency == 'Complete outage') {
// Use spModal to pop the HTML
if (html) {
spModal.open({
title: 'Notice',
message: html,
buttons: [
{label:'OK', primary: true}
],
});
}
}
}
Hope this helps!
Thanks,
Dan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 07:01 AM
You could use a client script that runs onchange of those 2 fields. If the script checks the value of the 2 fields it can then display an alert.
var impact = g_form.getValue('impact');
var urgency = g_form.getValue('urgency');
if (impact == "All" && urgency == "Complete Outage") {
alert("This is a high priority issue and will be fixed asap");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 07:37 AM
Hi Dan,
Will the above script work for service portal ?.
Also would like to know under which table i should write the client scriot you mentioned
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 07:43 AM
Yes it should work in the Service Portal.
https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/build/service-portal/concept/uns...
Is your form a table form or a catalog item/record producer?
If it is a table form, the client script needs creating against that table.
If it is a catalog item/record producer, you need to create a "catalog client script" for that catalog item/record producer.
I hope that makes sense and helps you out!
Thanks,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2020 08:24 AM
Hi Dan,
Mine is record producer and so i will try the above catalog client script.
Also along with the alert , i need the alert to be in Bold red color.
How shall i achieve it?
Thanks