- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 06:51 AM
Hello,
Is it possible to create a UI Action on an Incident form that then redirects to the another form on the same table? For example, our "Default" Incident view is quite cumbersome with lots of fields and functionality. Our idea is to create a simplified view of the incident form (called Phone Express) in another view. Users will use the simplified view to create a new incident...and if it's not an Open/Close incident or requires further investigation, we'd like to click an "Investigate" or "Continue" button from a UI action on the simplified view, that takes the user to the 'Default' view of the incident (with all the fields) so the user can continue working.
So far, I can't see anything on the community relating to this. Any thoughts on how to redirect to a specific view on the same table would be appreciated!
Thanks!
Lori
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 01:14 PM
Hi Lori -
Sorry about that, misunderstood what you were trying to achieve. Try this in the UI Action instead:
current.update();
action.setRedirectURL("incident.do?sys_id=" + current.sys_id + "&sysparm_view=default&sysparm_view_forced=true");
this also works:
current.update();
action.setRedirectURL("incident.do?sys_id=" + current.sys_id + "&sysparm_view=&sysparm_view_forced=true");
but I left default in there just so you know you can modify that section for different views.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 09:22 AM
create a ui action and use this function: switchView(type,table,view);
you can refer to SNGURU link for more info: http://www.servicenowguru.com/scripting/client-scripts-scripting/change-form-view-client-script/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 12:23 PM
Hi, Josh -
I have the following set in the UI Action called Investigate (which is a button):
current.update();
switchView('section','incident','');
Basically, a user will create a new incident from a simplified view called Phone Express and fill out some fields. If a user clicks the Investigate button from this view, I simply want to update the record, and move to the other view (which contains more fields for further investigation). And the view I want to redirect to is the default view which has no name (i.e., (empty)). Right now, I just have the following lines in the Script of the UI Action..but when I click on the button, it only takes me to the standard Incident List view - not the form of the incident I just created.
Is the 'section' type correct? Am I missing something else?
Thanks!
Lori
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 01:14 PM
Hi Lori -
Sorry about that, misunderstood what you were trying to achieve. Try this in the UI Action instead:
current.update();
action.setRedirectURL("incident.do?sys_id=" + current.sys_id + "&sysparm_view=default&sysparm_view_forced=true");
this also works:
current.update();
action.setRedirectURL("incident.do?sys_id=" + current.sys_id + "&sysparm_view=&sysparm_view_forced=true");
but I left default in there just so you know you can modify that section for different views.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2014 01:37 PM
This worked great! Thank you, Josh! I left the view name off (i.e., followed the second URL), to get to the default view that has no name.
Thanks very much!!
Lori