Shahed Shah1
Tera Guru

This is to round up my URL-related blog series. If you haven't seen them the links are Getting your ServiceNow URLs right and What's in a name.do?. You would have already seen useful snippets in the Docs, like URL schema, Examples of navigating by URL and Navigate by page URL (and more). I feel that once you get a good grasp of this, you will find useful tips and tricks to speed up your workflow. Case in point, while working in Customer Support, I try my best to be a URL ninja (don't know if I'm there yet) because Instances can be translated into other languages or modules are renamed. Plus, there are gotchas in the platform that can cause updates, which we totally want to avoid. Oh yeah, they exist.

 

Inadvertent changes

Let's start off with looking at inadvertent changes before I go ahead and give these other URL tricks. Now I say changes can inadvertently happen, precisely for that point where there's something within the platform, either by design or via a property which just plainly causes this to happen. Here's a quick list:

  • Clicking on the Reference Icon will submit the record
  • Changing the Form View
  • When iterating through a list of records
  • Enter Submits user preference

 

Clicking the reference icon

The sin of sins. Populate a reference field like Assigned to and then click on the Reference Icon. What happens? The form is submitted and then you are navigated to the referenced record.

Reference Icon.png

Complaints from this were non-stop. [Queue heavenly music] Now in Istanbul this behaviour was addressed! It's not exactly how some may have envisioned changing the behaviour, but now users are presented with an "Are you sure?" message

Save changes dialog.png

(Where have you been all my ServiceNow life?)

 

While we applaud this progress, those using releases before Istanbul need to be careful. So, how do we "workaround" this? Many have come up with their own solutions/workarounds:

  • Setting glide.ui.clickthrough.popup to true
    This will present the referenced record in a popup but does not show any Related Lists
  • I have seen some used Client Script to hide the Reference Icon and created a UI Macro (used as field decoration) to open the record into a new tab

 

What I do is not really a workaround to implement, but I like to keep snippets of handy URL formats. In this case of opening a referenced record, I just like to keep in mind a format of: /table_name.do?sysparm_query=displayfield=displayvalue. To demonstrate usage, let's say I'm clicking on the Reference Icon for the Caller field. Knowing that the field references the sys_user table (you can easily check this by right-clicking on the field and selecting the Show option), I would translate the snippet to /sys_user.do?sysparm_query=name=displayvalue.

Kingston Update

This one may have sneaked past you. Starting in Kingston the popup on hover has changed to a popup on click. Head on over to Reference field icon for more info.

 

Changing the Form View

That's right, whenever you switch the view of the current form, a submit is taking place. The other side to changing the view is that a User Preference is created/updated and, whenever you navigate back to the form, the platform will display it based on that User Preference. OK, that last part is kinda accurate, as long as glide.ui.remember_view property is set to true (it is true by default).

 

So, working around this is to not use that and stick with the sysparm_view URL parameter. When using UI16, the address bar of the browser is updated with an encoded URL to the record that you are looking at. You can look for or add this parameter and select the view you need.

backlink address.png(Yeah... I'm not gonna go through all that)

 

Like many of you, I use tabs extensively when working on, or troubleshooting, the platform. You can do this in many ways:

  • Typing tablename.LIST into the Application Navigator
    LIST (in capitals) will open a list into a new tab/window.
  • While viewing a list within the frameset, hold down the ⌘ key and clicking on the link (on a Mac) will open the record in a new tab. I use a Mac, but I'm pretty sure there's something similar for Windows machines.
  • Open the Frame into a new tab
    Firefox has this built in, where you click on an empty area of the page and select This Frame > Open Frame in New Tab.
    Open in new tab.png
    Google Chrome doesn't have this but you can add an extension such as Open Frame - Chrome Web Store

 

Once you have the form in a new tab, just go ahead and update or add the sysparm_view parameter with the name of the desired view. Leaving it empty (i.e. &sysparm_view=) will treat it as if you want to get the Default view. Setting it to &sysparm_view=ess will load up the form into the Self Service view if one exists for it. Have a look at the Views [sys_ui_view] table to get the list of View names (not labels) that you can use for a table you're working on.

 

Iterating through a list of records

This is in reference to those up/down navigation icons on the top-right part of the form.

Up Down Btn.pngNow, it's a conscious decision (I hope) made by the Developer(s)/Administrator(s) of your Instance to enable this behaviour, by setting the glide.ui.update_on_iterate property to true. Out-of-box the default value is false. Personally, I stay away from these and ⌘+Click from a filtered list to open the records into a new tab.

 

Enter Submits user preference

This is a weird one where the enter_submits_form is a system preference, where the record is submitted when you hit Enter on the keyboard.

 

URL tricks

Now for the main bit, phew. From the previous section, you will observe that I'm a proponent of tabs. Don't get me wrong, I'm not obsessed with tabs. I still like control and not have too many tabs open at one time.

 

As demonstrated earlier, getting those new tabs are pretty straightforward:

  • ⌘+Clicking from a list view will open a record into a new tab
  • typing tablename.LIST into the navigator opens a list into a new tab
  • typing tablename.FORM into the navigator opens an empty record into a new tab
  • typing tabename.CONFIG into the navigator opens up a new tab which is a combined view of Business Rules, Client Scripts, etc for that table

 

Then can manipulate the URL when a record is in a new tab to minimise on the issues I pointed out above. We have seen you can add/modify the sysparm_view parameter. Another key parameter is to use sysparm_filter_only when navigating to large tables and minimise on Performance issues. For example, I could navigate to /sys_audit_list.do?sysparm_filter_only=true which would take me to a page for the list, without bringing back any record, giving me the opportunity to provide a precise query.

Please be aware that the sysparm_filter_only parameter does not work in List v3 . This is documented in KB0620980.

You can see a theme developing here, right? The table name. It becomes a habit to remember as many table names as possible, rather than remembering a module and which application it sits in. The two driving factors for doing this are: instances can be translated so the module names can be different when impersonating a user; you want to get jazzy with the sysparm_view, sysparm_fiter_only or other parameters.

 

Large tables

To get you started, let's look at some of the tables where there's a huge amount of records that navigating to them directly is not a good idea and would benefit from using the sysparm_filter_only parameter:

  • Audit [sys_audit]
  • Logs [syslog]
  • Transaction Logs [syslog_transaction]
  • History Set [sys_history_set]
  • Events [sysevent]
  • ECC Queue [ecc_queue]
  • Emails [sys_email]
  • Customer Updates [sys_update_xml]
  • Upgrade History [sys_upgrade_history]

 

Visiting these tables are common for troubleshooting, so be sure to add these to whatever you use for storing snippets.

 

Common tables

Hopefully, by now you have an idea of the various tables you tend to visit for any development work or troubleshooting. Let's have a look at some:

  • Dictionary [sys_dictionary]
  • Business Rules [sys_script]
  • Script Includes [sys_script_include]
  • Client Scripts [sys_script_client]
  • UI Actions [sys_ui_action]
  • UI Policies [sys_ui_policy]
  • Scheduled Jobs [sys_trigger]
  • UI Scripts [sys_ui_script]
  • Plugin Activations [sys_plugins]

 

How many do you remember or recognise? Go ahead and look for the table names of UI Pages, UI Macros and Deleted Records in the Platform. There's plenty more to keep an eye for, but the list is just to get you started.

 

More shortcuts

Let's bring this to an end and look at some other tricks and shortcuts to add to your arsenal of snippets

  • Switching from UI16 to UI15 (?sysparm_userpref_use.concourse=false)
  • XML Stats (xmlstats.do)
    Plenty of information regarding the Instance, DB and Nodes.
  • Scripts - Background (sys.scripts.do)
    Not to be confused with sys_script.do which is for Business Rules
  • Side Door (side_door.do)
    If the Instance is configured to authenticate with SSO.
    It would be a good idea to create a search engine or bookmark with keyword in your browser of choice to use this

 

---

 

And that's it. I really hope you find these blog posts helpful with understanding and navigating around the ServiceNow platform.

3 Comments