When cancel a change request, I want a popup to appear asking if they are sure if they want to cancel the request.

mickd
Giga Contributor

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.');

}

1 ACCEPTED SOLUTION

nthumma
Giga Guru

Can you double check your action name on your UI action matches cancel_change, everything else looks good for me.


View solution in original post

11 REPLIES 11

mickd
Giga Contributor

This worked. I had the UI action name as cancelbutton instead of cancel_change. Once I fixed that, it worked. Thank you.


You can mark my response as correct


mickd
Giga Contributor

Its not giving me any options under action so I said it was helpful. I am not sure why it shows no actions available when I click on Actions.


To see actions you need to open the thread you cannot mark it as answer from your inbox


mickd
Giga Contributor

find_real_file.png


Currently I am in the thread. Here is what I see. Let me know if you are seeing the same thing.