Client Side Scripting Flashcards
What are the two types of scripts found in ServiceNow?
Client Side & Server Side
———————————————————————
📁 Client Side Scripting Developer Documentation
Where do client scripts execute?
Within a user’s browser
———————————————————————
📁 Client Side Scripting Developer Documentation
When do client scripts execute?
When forms are loaded, changed, or submitted
———————————————————————
📁 Client Side Scripting Developer Documentation
What are the main 2 reasons an onLoad client script would be used?
To manipulate a form’s appearance
or manipulate a form’s content
———————————————————————
📁 Client Side Scripting Developer Documentation
When does an onLoad script execute?
When a form is loaded.
———————————————————————
📁 Client Side Scripting Developer Documentation
When does an onChange script execute?
When a particular field’s value changes.
———————————————————————
📁 Client Side Scripting Developer Documentation
Why would you use an onChange client script?
An onChange client script will allow you to monitor fields that contain values of interest and modify the values or attributes of another field based on changes to your field of interest.
———————————————————————
📁 Client Side Scripting Developer Documentation
When do onSubmit scripts execute?
When a form is submitted
———————————————————————
📁 Client Side Scripting Developer Documentation
Why would you use an onSubmit client script?
Validate field values
———————————————————————
📁 Client Side Scripting Developer Documentation
What type of API is GlideForm?
Client-side
———————————————————————
📁 Client Side Scripting Developer Documentation
What does the GlideForm API do?
Provides methods for managing form and form fields.
Some Examples:
- Retrieve a field value on a form
- Hide a field
- Make a field read-only
- Write a message on a form or a field
- Add fields to a choice list
- Remove fields from a choice list
———————————————————————
📁 Client Side Scripting Developer Documentation
What syntax is used when implementing methods from the GlideForm API?
g_form.<method></method>
———————————————————————
📁 Client Side Scripting Developer Documentation
What types of scripts support the use of the g_form object?
Client side scripts
———————————————————————
📁 Client Side Scripting Developer Documentation
Can you list off some of the methods commonly used with the g_form object?
- getValue()
- addOption()
- clearOptions()
- addInfoMessage()
- addErrorMessage()
- showFieldMessage()
- clearMessages()
- getSections()
- getSectionName()
———————————————————————
📁 Client Side Scripting Developer Documentation
What does the GlideUser API do?
Provides methods and non-method properties for finding information about the currently logged in user and their roles.
———————————————————————
📁 Client Side Scripting Developer Documentation