Client Scripts ServiceNow 1702754037
Client Scripts ServiceNow 1702754037
Client Scripts
Client Scripts manage the behavior of forms, fields, and lists in real time & execute client-side
(web browser).
Some basic use cases of Client Scripts are:
1. Make fields mandatory.
2. Set one field in response to another.
3. Modify choice list options.
4. Hide/Show form sections.
5. Display an alert.
6. Hide fields.
7. Prohibit list editing.
*Note: Backend name for the client script table is sys_script_client.
Or you can Navigate through Application Navigator [All>System definition>Client
Scripts].
Enter the name for your client Scope of the Client Script.
script here. Execute the script for
.Select the
table forms from any extending
tables when selected.
Select whether the
script executes for If Global is selected the script
Desktop only, applies to all Views. If the
Mobile / Service Global field is not selected you
Portal only, or All must specify the View.
We have some method which are used for DOM Manipulation like
(getElement(),getElementByID()) so to avoid this manipulation servicenow by
default check this box if we use these method with the checked checkbox it will
not perform there respected funtionalities.
JavaScript APIs:
Provide classes and methods that can be used in scripts to define the functionality of the
platform.
Client-Side Classes Server-Side Classes
GlideRecord GlideRecord
GlideForm GlideAggregate
GlideAjax GlideDateTime
GlideUser GlideSystem
GlideList GlideElement
Types of Client Script:
1. onload Client Script 2. onChange Client Script