Glide Forms
Glide Forms
g_form.addDecoration('caller_id',' icon-star','ungamma','color-green');
addErrorMessage(String message)
Displays the specified error message at the top of the form.This message appears for approximately four seconds and then disappears
function onLoad() {
g_form.addErrorMessage('Please assign the ticket to a support group.');
}
function onLoad() {
g_form.clearMessages();
}
clearValue(String fieldName)
Removes any value(s) from the fiel
function onLoad() {
g_form.clearValue('short_description');
}
flash(String fieldName, String color, Number count )
Used to draw attention to a particular field. Flashes the specified color for a specified duration of time in the specified field.
This method is not supported by Service Catalog
function onLoad() {
g_form.flash('caller_id', 'orange', -4);
g_form.flash('category', 'white', -4);
g_form.flash('subcategory', 'green', -4);
}
getDecimalValue():
Returns the decimal value of the specified field.
function onChange(control, oldValue, newValue, isLoading) {
alert(g_form.getDecimalValue('percent_complete'));
}
The getDisplayBox(String fieldName):
This method is used to retrieve the display box for a specified field in a form.
The display box represents the bounding rectangle of the field on the form, including any padding and borders. The method takes a
single parameter, fieldName, which is a string representing the name of the field for which to retrieve the display box.
function onLoad() {
var caller = g_form.getDisplayBox('caller_id');
var assignee = g_form.getDisplayBox('assigned_to');
if (caller.value == assignee.value) {
g_form.clearMessages();
g_form.addInfoMessage('The Caller and Assignee are the same person.');
}
}
getDisplayValue(String fieldName)
Gets the display value from a form in Service Portal.