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

The script isn't working for me. When I try to turn on the debugger, it will not capture it because when I click on ok, it takes me back to the list view and it doesn't show me the debugger information. Any other suggestions?


As a note for future users - the code posted by Kalaiarasan P works great for Projects, so whatever is preventing the change from closing is likely due to another process, like workflows or business rules, as suggested.



One thing I already had in place though, that doesn't seem to be included here, is cancelling the workflow explicitly.   If there's an active workflow waiting for something, it'll evaluate each time the record is updated, so for example if your workflow is waiting for the state to NOT be work in progress, then you update the state to Cancelled, then the workflow will perform the next action, which may be setting the State to something else.


Hi Kalaiarasan P



i Request You, Can we able to Display Pop-up Box [ Dialog Box]   with message 'Thanks for Visit this Article"     when we click YES or NO buttons in KB Article??



find_real_file.png


i need a small help in this, 

 

in service portal if we open any request under the request details we have a cancel button, if we click that button, i want to cancel confirmation message, could you please help me in this

Widget name - "cancel request"

 Some times end users by mistakenly clicks cancel button,  so it directly cancelled, so i need this feature in service portal.

is their any code we can add in that widget?

 

find_real_file.png

Community Alums
Not applicable

Hi Siva,  by any chance do you have a code for this ?