OOB UI Action

servicenow14710
Tera Expert

For OOB UI Action "Revert to New" on change request table i need to add popup - as 'do you want to revert'.It should show two options yes no . If yes it should revert else it should not.

OOB code:

revertToNew(current);
action.setRedirectURL(current);

function revertToNew(changeRequestGr) {
var changeRequest = new ChangeRequest(changeRequestGr);
if (!changeRequest.revertToNew())
gs.addErrorMessage(gs.getMessage('State Model for {0} changes does not allow reverting change from {1} state', [changeRequest.getValue('type'), changeRequest.getDisplayValue('state')]));
}

Please help me in adding the popup with options.Thanks.

1 ACCEPTED SOLUTION

@servicenow14710 You can create a new UI page and call that UI page to existing 'Revert to New' UI Action.

UI Page :

Pravindra1_0-1683886489788.png

 

UI Action :

make sure to provide Action name, Check the 'Client' Check box and give a name to onClick function. 

Pravindra1_1-1683886571998.png

 

Update UI Action Script as below :

Pravindra1_2-1683886748813.png

 

View solution in original post

5 REPLIES 5

@Bert_c1 : Thanks Bert, This popup is OOB . I need this popup to come like a alert window with option syes, no.

I need this customisable popup using GlideModal

 

oob.png

@servicenow14710 You can create a new UI page and call that UI page to existing 'Revert to New' UI Action.

UI Page :

Pravindra1_0-1683886489788.png

 

UI Action :

make sure to provide Action name, Check the 'Client' Check box and give a name to onClick function. 

Pravindra1_1-1683886571998.png

 

Update UI Action Script as below :

Pravindra1_2-1683886748813.png