Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All 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
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
Author (1):
Arrow left icon
 Hauser Hauser
Author Profile Icon Hauser
Hauser
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Learning ServiceNow
Credits
About the Author
About the Reviewer
www.packtpub.com
Customer Feedback
Preface
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

The structure of an API class


First, let's define a few terms. According to Mozilla's object-oriented JavaScript documentation, a class is sort of like a template for an object. It pre-defines the methods and properties of an object generated from the class.

An object therefore, is simply an instance of a class!

A method is a function or subroutine that's declared as part of a class (and any objects that are instances of that class).

A constructor is a special type of function that runs when an object is declared as a new instance of a class using the new keyword. In ServiceNow, this constructor function is usually called initialize. Any arguments passed into the class during instantiation will be passed into this function, which effectively builds the object that will be returned.

Note

Naming convention dictates that while variable names use camelCase capitalization, class names use SentenceCase capitalization.

Here is a simple example of what a very simple class might look like:

var MyClass ...
lock icon The rest of the chapter is locked
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