Client-side Glide API
The client-side Glide API exposes many different methods that can be used to customize the UI, access user sessions, and perform AJAX. Let us quickly go through the different client-side classes available in ServiceNow. We will be using these APIs in the upcoming chapters.
GlideForm
The GlideForm JavaScript class consists of methods that can be used to customize forms and modify form data. There is no need to explicitly create an object of the GlideForm class. Instead, the g_form variable is a global object and is available and accessible from all client-side scripts.
The following are some examples of GlideForm:
- The
void setReadOnlymethod of theGlideFormobject can be used to make a form field read only. It accepts two parameters -fieldnameand thebooleanread only property:
g_form.setReadOnly("fieldName",true) - The
void setValuemethod of theGlideFormobject can be used to change the value of aFormfield:
g_form.setValue(fieldname, value)
GlideUser
The...