- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2016 01:00 PM
Hi, I would like some assistance in creating a UI Action on a custom table I created.
This button needs to save the form on table 1, and then redirect the user to a second/table form.
How would I script/build this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2016 01:43 PM
Hi Vibee,
Your script will contain two basic components.
current.update(); // save the current record (from table 1)
action.setRedirectURL(url_to_table_2_record);
The details of that url_to_table_2_record are up to you. It can either be a GlideRecord or a string. For example, if you have a GlideRecord for your other table...
var t2 = new GlideRecord('u_table2');
t2.get(current.u_reference_field_to_table2);
action.setRedirectURL(t2);
The above could also be done like this:
action.setRedirectURL('u_table_2.do?sys_id=' + current.u_reference_field_to_table2);
Or if you want to create a new record on table2, it might look like this:
action.setRedirectURL('u_table2.do?sys_id=-1');
That should give you some ideas. 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2016 01:04 PM
Hi Vibee,
Please refer below thread and adjust your solution. Let me know if you are blocked.
Client & Server Code in One UI Action - ServiceNow Guru
For reference you can refer UI action "Create Change" on incident form which redirects to change request using action.setRedirectURL

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2016 01:45 PM
Here is the example that you can refer. Just replace with yourinstance name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2016 01:43 PM
Hi Vibee,
Your script will contain two basic components.
current.update(); // save the current record (from table 1)
action.setRedirectURL(url_to_table_2_record);
The details of that url_to_table_2_record are up to you. It can either be a GlideRecord or a string. For example, if you have a GlideRecord for your other table...
var t2 = new GlideRecord('u_table2');
t2.get(current.u_reference_field_to_table2);
action.setRedirectURL(t2);
The above could also be done like this:
action.setRedirectURL('u_table_2.do?sys_id=' + current.u_reference_field_to_table2);
Or if you want to create a new record on table2, it might look like this:
action.setRedirectURL('u_table2.do?sys_id=-1');
That should give you some ideas. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 10:13 AM
I am trying the reDirect, but i'm not sure where I can pull the table name for the Order Guide. I would like it to redirect to a new Order Guide page.
would it be action.setRedirectURL(https://is/com.glideapp.servicecatalog_cat_item_guide_view.do?v=1&sysparm_initial=true&sysparm_guide... );