- 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-25-2020 03:45 AM
Hi Dan,
It does not work as expected,i am still seeing english popup.
Can i have a deep insight on this ?
Also would like to know why two records should be created in message table?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2020 04:22 AM
You need a UI Message record for each language that you want the language to be displayed in. So if you want the language displayed in English, French, or Dutch you would need 3 records.
If a user has their language preference on their user profile set to French, ServiceNow will retrieve the French UI Message record, and if a user had their language set to Dutch ServiceNow would retrieve the Dutch version.
I have tested this when being logged in as 2 different users, one of which had language set to French.
Change the Catalog Client Script code to be:
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');
// If impact and urgency match the values
if (impact == 'All users facing issue' && urgency == 'Complete outage') {
// Get the message in the users language
getMessage("high_priority_issue", function(msg){
var html = '<font color="red" size="4"><p><strong>' + msg + '</p></strong></font>';
// Use spModal to show the message
if (html) {
spModal.open({
title: 'Notice',
message: html,
buttons: [
{label:'OK', primary: true}
],
});
}
});
}
}
UI Message Records:
Alert when the users language preference is French: