Cancel confirm window after clicking cancel button

jesusemelendezm
Mega Guru

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.

1 ACCEPTED SOLUTION

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


}


View solution in original post

32 REPLIES 32

Let me re-read it where attached?


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


}


I did exactly like this- however It returns me to the list- when I look for the change record. It is not cancelled. It is still in the same state that It was.


are you getting the info message?


you know what. It works now. But for some reason. The state is changing to closed complete instead of "cancelled". I searched on the value for the "cancelled" state and It is 8.



What can be causing this issue?



if(typeof window == 'undefined')


      {


      current.state = 8;


      current.update();


      action.setRedirectURL(current);


      gs.addInfoMessage('The current change request has been cancelled.');


}