Glide class works hand in hand with ServiceNow to use databases and perform operations on the UI objects and pages.
Glide mainly shares Javascript APIs to deal with front-end and back-end, resulting in a highly interactive and user-friendly application.
Glide classes are divided into two further categories: client-side and server-side.
Let’s take a closer look at these.
To set a value in the field, setValue(name, value)
comes into play. This function can be used from any of the sub-classes.
GlideClassElement.setValue(name, "value");
GlideClassElement
is the glide class sub-element that we need to set for GlideRecord, GlideForm, etc.name
is the title of the field that we want to update. The data type of this field is string
.value
is the new value that we want to set. The data type of this field is object
.void
.To get a value, we use the getValue(String name)
function. It returns a string containing the value of the field.
getValue(String name)
returns null if the field is empty or does not exist.
GlideClassElement.getValue(name);
GlideClassElement
is the glide class sub-element that we need to get.name
is the title of the field that we want to update. The data type of this field is string
.Free Resources