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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering ServiceNow Scripting

You're reading from   Mastering ServiceNow Scripting Leverage JavaScript APIs to perform client-side and server-side scripting on ServiceNow instances

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781788627092
Length 226 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
 Kindred Kindred
Author Profile Icon Kindred
Kindred
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Title Page
Packt Upsell
Contributors
Preface
1. Getting Started 2. Exploring the ServiceNow Glide Class FREE CHAPTER 3. Introduction to Client-Side Scripting 4. Advanced Client-Side Scripting 5. Introduction to Server-Side Scripting 6. Advanced Server-Side Scripting 7. Introduction to Custom Pages 8. Scripting with Jelly 9. Debugging the Script 10. Best Practices 11. Deployments with the Update Sets 12. Building a Custom Application Using ServiceNow Scripting 1. Other Books You May Enjoy Index

Testing server-side scripts


As with client-side scripting, there are a few ways to test server-side scripts. These are generally less immediate than the client-side debugging techniques, but essential when working to fix your code.

gs.log

The first logging technique we will look at is gs.log. This was a very popular technique, and still is fairly widely used by developers. As we saw in Chapter 2, Exploring the ServiceNow Glide Classgs.log lets us send logs to the system log with a script source so we can send messages as a piece of code executes. 

We can create a gs.log from any server-side script, which makes it very useful; however, we cannot use it in a scoped application. We will have a look at scoped application logging later. As long as you are in the global scope, you can use gs.log and send messages to the system logs.

Let's remind ourselves of a simple piece of code using a gs.log:

gs.log('Server Side Log Message');

This log will appear in the Script Log Statements module in the application...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering ServiceNow Scripting
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 $15.99/month. Cancel anytime
Visually different images
Modal Close icon
Modal Close icon