Need to disable dialog window when trying to cancel a change request in New state

dassan
Tera Contributor
 
2 REPLIES 2

Tanushree Maiti
Tera Patron

Hi @dassan 

 

Solution is given in this post - Script which needs to update in your UI Action "Cancel Change" :

How cancel change UI page is called from UI action? 

 

Replace the existing code with the following snippet, ensuring you use the correct Action Name .
 
function setChangeCancelState() {
     gsftSubmit(null, g_form.getFormElement(), 'state_model_move_to_canceled'); 
}

if (typeof window == 'undefined') {
     current.state = '4'; 
    current.update();
    action.setRedirectURL(current);
}
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Hello Tanushree, 

I was able to get the solution from changing the script include mentioned for Change module 

Change Form UI, added the below script 

 

isCancelAvailable: function() {
        return this._evaluateCondition(function(changeGr) {
            if(changeGr.state != -5)
             return false;