- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 04:56 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 client script but does not work.
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 (response == true){
gsftSubmit(null, g_form.getFormElement(), 'sysverb_mim_propose'); //MUST call the 'Action name' set in this UI Action
} else {
// If cancel is pressed or the dialog is closed the response is empty
return false;
}
}
}
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 07:04 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 07:21 AM
May be it is returning back.
Are you sure your gsft function is being called. Also i am not fully but if you can trigger the ui action from client submit. Put a alert inside the ui action client script function and test it.
also put an alert above gsft submit line and test if its coming there or not.
Mark the comment as a correct answer and helpful if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 08:40 AM
Hi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2021 05:55 AM
Hello Usmaan,
you need to add alerts in your code and test it. Add at different lines and check till where you are getting the control.
the syntax to add alerts
alert("test");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 02:59 AM
Hi
I was getting all the alerts, however the gsftsubmit function still not working.
function onSubmit() {
var priority = g_form.getValue('priority');
if (priority == 1 || priority == 2) {
alert("test inside first if");
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.');
alert("test between ifs");
// If cancel is pressed or the dialog is closed the response is empty
if (response == true){
alert("test inside second if");
gsftSubmit(null, g_form.getFormElement(), 'sysverb_mim_propose'); //MUST call the 'Action name' set in this UI Action
alert("test after gsftsubmit");
} else {
return false;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 06:30 AM
all the alerts came back fine, but the gsft submit function still not working