Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

When using setRedirectURL can I specify the View to be used?

Brian Broadhurs
Tera Contributor

I have created a custom UI Action on the Release form to create a Change Request record linked to the Release. My problem is that the Release form is displayed using the Release view, and when I redirect to the newly created Change Request record, the system uses the Release view of the Change Request form - except there isn't a form defined for that view, and instead of displaying the default view, the system actually creates a form section for the Release view - but it doesn't bear any resemblance to any of the other views on the Change Request form.

I would like to be able to tell the system, in the UI Action script, to use the Default view when I specify the Redirect URL - is this possible?

Brian Broadhurst

1 REPLY 1

Brian Broadhurs
Tera Contributor

I managed to work this out with the help of a colleague:

chg.insert();
action.setRedirectURL("change_request.do?sys_id=" + chg.sys_id + "&sysparm_view=default");