UI Action - Insert and Stay

hongsok
Tera Contributor

Hello All,

I have created a UI Action to copy the change request and View Rule (name: ITO).

Everything is working fine except it does not stay on the new record.

Here is the script:

var gr = new GlideRecord("change_request","&sysparm_view=ITO&sysparm_view_forced=true");
gr.initialize();
gr.category = current.category;
gr.u_category_type = current.u_category_type;
gr.u_category_item = current.u_category_item ;
gr.cmdb_ci = current.cmdb_ci ;
gr.priority = current.priority ;
gr.risk = current.risk ;
gr.impact = current.impact ;
gr.urgency = current.urgency ;
gr.short_description = current.short_description ;
gr.description = current.description ;
gr.u_ito = current.u_ito ;
gr.assignment_group = current.assignment_group ;
gr.assigned_to = current.assigned_to ;
gr.u_need_justification = current.u_need_justification ;
gr.change_plan = current.change_plan ;
gr.backout_plan = current.backout_plan ;
gr.test_plan = current.test_plan ;
gr.u_test_results = current.u_test_results ;
gr.u_notification_plan = current.u_notification_plan ;
gr.u_verification_plan = current.u_verification_plan ;
gr.state = current.state ;

gr.insert();

action.setRedirectURL(current);

 

7 REPLIES 7

Hi Allen,

No, it is not working. That was my first tried.

Abhinay Erra
Giga Sage

Try this

 

action.setRedirectURL(gr.getGlideRecord());

hongsok
Tera Contributor

No, it goes to the instance home screen.