ServiceNow Scripting Fundamentals Flashcards
When should you script? (5)
- Add new functionality
- Extend existing functionality
- Guide users through messaging (alerts/notification)
- Automate processes
- Interact with third party applications
Which administrator develops in the global scope?
System Administrator
Which administrator develops in a certain piece (like business rules), typically within a certain application?
System Definition Administrator
What is the name of ServiceNow’s built in text editor and what are it’s features?
Syntax Editor:
- Automatic Javascript syntax coloring, auto-indentation, line numbers, creation of closing braces and quotes
- Context-sensitive help
- Code editing functions
- Syntax Editor Macros for typing commonly used code
- Syntax error checking
What color does blue represent in the Syntax Editor?
Reserved words
What do Bold/Italics represent in the Syntax Editor
Context menu items
What does the color green represent in the Syntax Editor?
Comments
How does Syntax Editor help with braces and quotes?
- It automatically adds the closing quote, braces or parenthesis
- It highlights pairs of brackets/parentheses
What is the benefit of using single quotes in JavaScript?
Values within single quotes can be compared with equals, equals equals, numeric comparisons and more.
What functionalities does the Context-sensitive Help provide?
- Displays a list of valid elements at the cursor’s current position
- Lists methods for a class
- Lists expected parameters
How do you display valid elements at the cursor’s current position within the Syntax Editor?
CTRL + Spacebar at the beginning of a line
How do you view a list of methods for a class within the Syntax Editor?
Type a period after the class name
How do you view a list of expected parameters for a class or method?
Type open parenthesis after a valid class, function or method name.
If you create custom objects, does the Syntax Editor provide any suggestions for variables belonging to the object?
Yes, if you type a period after the object, it will suggest variables belonging to the object.
What options are presented when you right click on bold/italicized text within the Syntax Editor?
The context menu:
- Show definition
- Show data
- Find references
How do you find a list of other places an object is used from within Syntax Editor?
Right click on the context menu and click ‘Find references.’
What is an alternative method of adding commments to manually typing forward slashes?
- Highlight applicable text
- Click the “Toggle Comment” button in the bar at the top of the Syntax Editor.
True or false: “Replace all” asks for confirmation before making the replacement(s)?
False. It does not.
What contains shortcuts for commonly used code?
The Syntax Editor Macros
How do you insert a Syntax Editor macro into your code?
Type the macro name and press tab.
How do you find the full list of Syntax Editor macros within the editor?
Type “help” and press tab.
What can the Syntax Editor “Syntax Checker” find?
- Missing characters, such as { and [
- Missing ; at the end of statements
- Incomplete arguments in for loops
- Bad function calls
What is the Syntax Editor “Syntax Checker” not able to find?
Typos, in:
- variable names
- function calls
- method calls
What do red circles indicate in Syntax Editor? Orange?
- Red: Errors
- Orange: Warnings