How to show an alert or info message on a redirected change form when clicking on the "copy change" UI action ?

ads
Tera Expert

Hi All,

When I am clicking on the 'Copy Change' ui action, its redirected to the a new change form with some field values. I want to show a message when the new change form shows.

I have tried to add the gs.addInfoMessage("your message here"); in the ui action script , But its not working. Can anyone please help me out on this.

6 REPLIES 6

Sagar Pagar
Tera Patron

Hi,

you can use the onload client script on change request table, when Parent is not empty condition and show the alert message.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar ,

When I will click on the 'copy change' ui action, it redirects to the unsaved new change form with the field values copied from the existing change. I need the message on the new unasved change form . I think its not possible through the client scripts and the parent field is not available in change.

Hi,

We have OOTB parent field on change request. through Copy chnage we can update it. and use in condition.

 

Also, you can check condition for new record as well.

 

if(g_form.isNewRecord() && Parent!=''){

alert("your message"); or g_form.addInfoMessage("your message");

}

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi, 

Thanks for the response.

I understand, but we are not updating the parent field when coping the change request. is there any other way to do this ?