Lots of developers I know have been frustrated by the Back button in ServiceNow redirecting them to unexpected places, sometimes going to the last page, and sometimes returning to a new record.

This is mostly caused by the "Navigation Stack", which stores the pages that you have loaded within the current session (yes, session-wide) which can result in some weird stuff when you are using ServiceNow across multiple tabs.

I have developed a small application that allows the back button to be used as a menu-button for admin users:

The replacement backUtils menu.

This allows you to select a custom option, hopefully returning to a page that you expecting.

The options are:

  • Frame History Back - Navigates back in the current frame's context.
  • Navigate to Item List - Open a list of the current record in this frame/window.
  • Navigate to New Record - Open the new record form for this record type.
  • Current Record in New Tab - Opens this record in a new tab.
  • Record List in New Tab - Opens a list of this record type in a new window.
  • Back (StackBottom) - Go to the page located at the bottom of the ServiceNow Navigation Stack
  • Back (StackTop) - Go to the page located at the top of the ServiceNow Navigation Stack.
  • Frame History Back (OOB) - Your Typical Back button function.

(last three items are for more advanced users)

My goal for this project was to expose more options in the back behavior.

The solution that I put together was based heavily on the UI 16 Developer Patch, by James Neale. It consists of the following objects:

  • UI Script (global)
  • Script Include (to support server-side GlideStack calls)

It makes use of the following ServiceNow API's:

  • jQuery (client-side)
  • GlideSession
  • GlideStack (undocumented)

There are likely some bugs in this, and I will be continually improving on it.

The plugin is now published on Share: https://developer.servicenow.com/app.do#!/share/contents/8774514_back_utils?v=1.6&t=PRODUCT_DETAILS