g_form Methods
Access GlideForm methods using the g_form global object
g_ form. <method name> (parameter information) ;
=> Syntax
- Examples
- g_form. setValue ('impact ', 1);
- g_form.showFieldMsg( state' , 'Change is waiting approval', ' info');
Commonly used g_form method examples
- Draw attention to an area on the form: flash(), showFieldMsg()
- Get field information: getValue(), getReferenceO
- Change a field value: setValue(), clearValue()
- Change a choice list: addOption(), clearoptions()
- Get form information: getSections(), isNewRecord()
- Form actions: addlnfoMessage(), clearMessages()
GlideForm methods are only used client-side.
Examples:
- g_form.addlnfoMessage() — displays an informational message at the top of a form.
- g_form.addOption() — adds an option to the end of a Choice list.
- g_form.clearMessages() — removes messages previously added to the form.
- g_form.clearoptions() — removes all options from a Choice list.
- g_form.clearValue() — clears a field's value.
- g_form.flash() — flashes a field's label to draw attention to it.
- g_form.getReference() — retrieves a reference object from the database.
- g_form.getSections() — returns the elements of a form's section as an array.
- g_form.getValue() — retrieves a field's value.
- g_form.isNewRecord() — returns true if a record has never been saved.
- g_form.setValue() — sets a field's value.
- g_form.showFieldMsg() — displays a message under a form field.