Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning ServiceNow

You're reading from   Learning ServiceNow Get started with ServiceNow administration and development to manage and automate your IT Service Management processes

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781785883323
Length 358 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Sylvain Hauser Sylvain Hauser
Author Profile Icon Sylvain Hauser
Sylvain Hauser
Tim Woodruff Tim Woodruff
Author Profile Icon Tim Woodruff
Tim Woodruff
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

1. The Interface FREE CHAPTER 2. Lists and Forms 3. UI Customization 4. Understanding Data and Relationships 5. Tasks and Workflows 6. UI and Data Policies 7. User Administration and Security 8. Introduction to Scripting 9. The Server-side Glide API 10. The Client-side Glide API 11. Server-side Scripting 12. Client-side Scripting 13. Debugging 14. Pro Tips

Content frame

The Content frame is where you'll find the lists, forms, pages, and other contents. When left-clicking on a module in the Application Navigator (with a few exceptions such as the Workflow Editor), the resulting page, list, or form will load in the Content frame:

The content frame is displayed inside the ServiceNow frame (under the banner, and to the right of the Application Navigator). However, you can actually break the content frame out from the ServiceNow frame by opening a link in a new tab or window.

Whether it's a link inside the content frame itself, or a module in the application navigator, opening the link in a new tab or window (whether from the right-click menu, by middle-clicking, or by Ctrl-clicking the link) will open the link in just the content frame.

Without the content frame, the URL will look something like this:

https://your_company.service-now.com/incident_list.do

With the content frame, the URL will look like this:

https://your_company.service-now.com/nav_to.do?uri=incident_list.do

Adding nav_to.do?uri= before the rest of the URL after the forward-slash following the domain name (service-now.com) essentially navigates to the ServiceNow frame (located at nav_to.do), and passes a URL parameter (the bit after the question mark) named uri with a value of whatever text happens to follow the equals sign.

URL parameters can be strung together using the ampersand (&), and can be accessed as name-value pairs via client scripts. For example, have a 
look at this URL: www.url.com/page?parmOne=code&parmTwo=is%
20cool
. This URL contains two parameters: parmOne and parmTwo. parmOne is set to the string code, and parmTwo is set to the string is cool (because we URL-decode the %20 to a space).

So if you middle-click or otherwise open a link in a new tab, you'll be directed to the URL sans nav_to.do?uri=, but you can easily add this back into the URL. However, there's a small catch here. Only the first URL parameter uses the question mark. Any subsequent parameters use an ampersand.

If you find yourself opening new tabs very often, yet needing to pop them back into the ServiceNow frame (as I very often do!), you create a browser bookmarklet to do just that using a little bit of JavaScript. You'll have to take my word on this for now, but putting this in as the URL for a bookmark, and then tapping the bookmark when you want to drop the page you're on into a ServiceNow frame, will do the trick:

Javascript: (function(){var a=window.location.href;if(0<=a.indexOf("navpage.do")||0<=a.indexOf("nav_to.do")||0<=a.indexOf("workflow_ide.do"))alert("Looks like you're already inside a frame!");else if(0<=a.indexOf("service-now.com/")){var b=a.indexOf("://"),b=a.indexOf("/",b+3)+1,c=a.slice(0,b),a=a.slice(b);window.location.href=c+"nav_to.do?uri="+a}else alert("That only works on ServiceNow pages.")})(); 

If you're curious, here's the de-minified version of that code:

javascript: (function () 
{
var a = window.location.href;
if (0 <= a.indexOf("navpage.do") || 0 <= a.indexOf("nav_to.do") || 0 <= a.indexOf("workflow_ide.do")) alert("Looks like you're already inside a frame!");
else if (0 <= a.indexOf("service-now.com/")) {
var b = a.indexOf("://"),
b = a.indexOf("/", b + 3) + 1,
c = a.slice(0, b),
a = a.slice(b);
window.location.href = c + "nav_to.do?uri=" + a
}
else alert("That only works on ServiceNow pages.");
})();
You have been reading a chapter from
Learning ServiceNow
Published in: Mar 2017
Publisher: Packt
ISBN-13: 9781785883323
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image