Navigation stack

The navigation stack is the portion of the ServiceNow suite of applications that determines where a user will be redirected after the update of a record.

It is also possible to cause page references to be manually inserted into the the Navigation Stack when a link in the Navigation Page is clicked. This is done by modifying a module definition to include an argument of sysparm_stack with a string value equal to the URL reference to the page that should be inserted into the stack. Finally it is also possible to override the redirection determined by the stack entirely by creating a business rule or editing an existing one to include gs.setRedirect("http://redirect_page.com").

Operating parameters of the Navigation Stack

The Navigation Stack can be thought of a user's navigation history in the ServiceNow system. It is updated every time a user views a new page. The Navigation Stack is referenced when users press the ServiceNow back button. It is also referenced when a user updates a record, at which point the user is redirected to their last page in the Navigation Stack.
Figure 1. Back and Update

Inserting pages to the Navigation Stack

It is also possible to cause page references to be manually inserted into the the Navigation Stack when a link in the Navigation Page is clicked. This is done by modifying a module definition to include an argument of sysparm_stack with a string value equal to the URL reference to the page that should be inserted into the stack. The following screen shot shows the out of the box definition for the Create New Incident Module. By passing an argument of "sysparm_stack=incident_list.do" we are adding the page "incident_list.do" (the list view of incidents) to the the stack so that after creating a new incident this will be the page that a user is redirected to.
Figure 2. Sysparm stack example

Overriding the redirection behaviors of the Navigation Stack with onEvent business rules

The redirection behaviors that occur as a result of Navigation Stack behaviors can be overridden using onEvent business rules. This is done using the Glide System function gs.setRedirect. Doing so will override the redirection as determined by the Navigation Stack, when the particular even specified occurs. The function gs.setRedirect takes a string argument that is a URL for the page that it is desired that the user be redirected to. This can be an external URL such as http://www.Google.com.
Figure 3. Redirect business rule
Figure 4. Business rule redirect results