ServiceNow Client Script
ServiceNow Client Script
A client-side script that runs JavaScript on the client (web browser) when client-based events
occur.
Client scripts are used to customize the behavior of a form or other UI element.
They can be triggered by a user action such as clicking a button or by an event such as the loading of a
page.
Note *** Client scripts are executed by the browser. It is important to make sure any DOM calls are as
technology agnostic as possible.
Type: Select when the script Global : Script runs on all views of table.
runs: onChange, onLoad, or onSubmit.
View: Specifies the View to which the script applies
control : the DHTML (Dynamic Hyper Text Markup Language) widget whose value changed.
oldValue : value of the field when the form loaded and prior to the change.
newValue : value of the field after the change.
isLoading : boolean value indicating whether the change is occurring as part of a form load. Value is true if
change is due to a form load. When forms load, all the field values on the form change as the record is
loaded into the form.
isTemplate : boolean value indicating whether the change occurred due to population of the field by a
template. Value is true if change is due to population from a template.
while (userRec.next()) { }
traineesRecord.push(userRec.email);
}
}
return traineesRecord.toString();
},