- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 04:33 PM
If the user click ok, I want the change to update the state to cancel and active to false. IF they click cancel, it goes back to the change with no updates. This is the script that I have for the cancel UI action but it is not working. Nothing is getting updated when I click ok. Our cancel state is 4.
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 = 4;
current.update();
action.setRedirectURL(current);
gs.addInfoMessage('The current change request has been cancelled.');
}
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 04:53 PM
Can you double check your action name on your UI action matches cancel_change, everything else looks good for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 04:51 PM
Hello Mickey,
Replace your code with the below-updated code and let me know.
function cancelTicket(){
var answer=confirm("Are you sure you want to cancel this record?");
if (answer==false)
{
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'cancel_change'); //MUST call the 'Action name' set in this UI Action
}
if(typeof window == 'undefined')
updateChange();
function updateChange()
{
current.state = 4;
current.update();
gs.addInfoMessage('The current change request has been cancelled.');
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 05:13 PM
This did not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 05:14 PM
This worked. I had the UI action name as cancelbutton instead of cancel_change. Once I fixed that, it worked. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 04:53 PM
Can you double check your action name on your UI action matches cancel_change, everything else looks good for me.