On Click of UI action should not create a record in change table.

Pav1_siva
Giga Contributor

Hello Experts,

 

We have an Ui Action on case table called Create Normal Change and we need to change the behaviour of that button.

Once we click on Ui Actio, It is inserting a new record in change table and copying some date from case to normal change.

So we need to change the behaviour like, Once we click on create change request button, It should redirect to new normal change page and populate some fields from case and show the pop up saying " Please save/submit the form to insert this change".

So it should not create a new record in table when we click create normal change, it should only insert when we click on save/submit in change record which got redirected.

Please help me with the code ASAP.

Pasting the example code below :

 

var url = new GlideRecord("change_request");
url.initialize();
url.requested_by = gs.getUserID();
url.short_description = current.short_description;
var ur = "change_request.do?sys_id=" +url.sys_id;
 
Looping @Ankur Bawiskar , @Ravi Chandra_K ,  @Community Alums 
 
Thanks in advance
 
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Pav1_siva 

so you want user to be redirected to new change form with some fields auto-populated and then user will fill other fields and save the record?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Yes, i am looking the exact requirement as you said. Please help me with the code.

 

Thanks,

@Pav1_siva 

you can use this script in UI action

var url = '/change_request.do?sys_id=-1^sysparm_query=requested_by=' + gs.getUserID() + '&short_description=' + current.short_description;
action.setRedirectURL(url);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader