- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 08:31 PM
Hi SN folks,
What can I use to configure a confirm pop up - when clicking cancel button on the change form. If user press cancel - It will ask confirmation, if press OK - cancel change- if cancel It must return to change form without cancelling the record.
Thanks for your help.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- 56,677 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 08:50 PM
attachment seems not be working for me ....
this is the code ...
Note : check the 'client' checkbox and in 'onlick' field , paste this cancelTicket();
function cancelTicket(){
var answer=confirm("Are you sure you want to cancel this record?");
if (answer==true)
{
gsftSubmit(null, g_form.getFormElement(), 'cancel_change'); //MUST call the 'Action name' set in this UI Action
}
else
{
return false;
}
}
if(typeof window == 'undefined')
{
current.state = 8;
current.update();
action.setRedirectURL(current);
gs.addInfoMessage('The current change request has been cancelled.');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2022 07:46 AM
As at Jan 2022:
1. If you're looking to cancel a "Change request", the state needs to be set to '4',
i.e. current.state = 4; instead of current.state = 8;
2. The "Action Name" referenced in his comments appear to match the sys_id of your UI Action if you check the 'data-action-name' DOM element of the cancel button,
i.e. gsftSubmit(null, g_form.getFormElement(), '5f2777b3Hb100200d71cb9c0c24c9c91'); //sys_id of your UI Action.
---------------------------------------Full Script Below--------------------------------------------
//Note: The 'Client' checkbox must be ticked on the UI Action.
//Note: The 'Onclick' field must contain the function name i.e. cancelChange();
function cancelChange(){
var answer=confirm("Are you sure you want to cancel the change request?");
if (answer==true) {
gsftSubmit(null, g_form.getFormElement(), 'your_ui_action_sys_id');
} else {
return false;
}
}
if (typeof window == 'undefined'){
current.state = 4;
current.update();
action.setRedirectURL(current);
gs.addInfoMessage('The change request has been cancelled.');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2018 06:58 AM
Thank you for all your responses.
I have the same requireement but when the user click OK then it ask for some mandatory field. However after filling the fields pop up comes again. Is there any way to set user preferences here to avoid this pop up coming twice ?
Regards,
Kopal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 10:05 AM
return false(); doesn't work in onchange client script.
so if cancel is clicked for confirm box then value should remain old one and confirm box should vanish.
how to achieve this??