- 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,668 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
06-21-2017 02:31 AM
Hi,
it didn't work because you used the code for the server side (current, gs etc.)
It would have worked if you used the code for client side "g_form"
function runClientCode(){
var answer=confirm("Are you sure you want to cancel this record?");
if (answer==true)
{
g_form.setValue('state', 8);
g_form.save();
alert('The current change request has been cancelled.');
}
else
{
return false;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 12:39 AM
just to add to Kalaiarasan P's reply, use above script as the clientSide Script in the UI Action 'Cancel'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 12:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 02:09 AM
Try this in an onSubmit client script:-
var action = g_form.getActionName();
if(action=="cancel_request"){ //your Cancel button's action name
var con = confirm('Are you sure you want to cancel this request?');
if(con){
gsftSubmit(null, g_form.getFormElement(), 'cancel_request'); //your Cancel button's action name
}
else{
return false;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 08:40 PM