- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 04:59 AM
Hi all,
I have the following requirement:
1) If a users selects P1 or P2 as the incident priority the user is alerted with a pop-up that asks the user to confirm if they want to propse a MI
2) If the user selects continue the Propose a MI workflow is initiated.
So the confirm should only popup if the priority field CHANGES to 1 or 2, and not if it already is 1 or 2.
I have tried using the following onChange clie
function onSubmit() {
var priority = g_form.getValue('priority');
if (priority == 1 || priority == 2)
var response = confirm('Priority 1 & 2 tickets follow the major incident process. Please confirm that you would like to propose this ticket as a Major Incident.');
If cancel is pressed or the dialog is closed the response is empty
if (!response){
return;
}
gsftSubmit(null, g_form.getFormElement(), 'sysverb_mim_propose'); //MUST call the 'Action name' set in this UI Action
}
the confirm function works and it pops up but the UI action does not trigger.
Please advise.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 10:24 AM
Solution has been added on thread below.
Please mark the answer correct and close this thread as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 05:48 AM
Hi,
So the confirm box should be shown only when Priority changes.
But UI Action won't know if value changed.
Try this in UI action; I haven't tested
var priority = g_form.getControl('priority');
if(priority.changed){
}
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
‎12-10-2020 06:02 AM
Ideally, I don't want to adjust the UI action for this specific condition, as this should only be applied for the client script, the UI action should be available to be used separately also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 06:24 AM
Hi,
I don't get you don't want to update UI action.
Can you explain what should happen
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
‎12-10-2020 06:28 AM
so when the priority of the incident changes to 1 or 2, the confirm box should appear with message, and if user clicks confirm then the UI action propose major incident should get triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 04:50 AM
Hi