FieldContext
Purpose
For any field in an object record form on a new, edit, status change, or quick
create page, a FieldContext object encapsulates state and behavior
details for the associated field. The FieldContext object is only
available in the New UI. You can access a FieldContext object using
the client-side function rbf_getFieldContext().
Note:
The methods in this section apply to the new UI, not the classic UI. Most Platform tenants are using the new UI. However, tenants on older Private Cloud installations might still be using the classic UI.
These methods are not supported in portals.
Interface
The following functions return information about the state of the field:
getNode()— Returns ajQueryobject for the HTML control (input, select, textarea, etc.)
getKendoConfig()— Returns the Kendo configuration object for the field (if the field is a Kendo control). Infinite Blue recommends using this function to access the Kendo configuration object for a field. It is faster and easier than using other methods, and it uses wrappers provided by Platform instead of working directly with the page DOM.getFieldType()— Returns a string identifier for the field type, for example,'IntInput'for Integer fieldsgetFormNode()— Returns ajQuerynode reference for the form element in t\he page DOMgetContainer()— Returns ajQueryobject for the root container element that holds the field control and its related DOM elements
The following functions return information about and allow you to specify the field's behavior:
validate()— Runs client-side validation against the fieldenable(isEnabled)— Toggles whether the field is enabled or disabled.show()— Shows the fieldhide()— Hides the fieldfocus()— Gives focus to the fieldisRequiredField()— Returnstrueif the field is marked as a required form field, otherwise returnsfalse.getValue()— Returns the field's current valuesetValue(value)— Sets the field's value tovalueaddOnChangeHandler(handlerFunc)— Adds the change handler functionhandlerFuncto the fieldgetInitialValue()— Returns the initial value of the form field when the form page was renderedhasValueChanged()— Returnstrueif the field value was modified on the form pagegetPicklistCode()— Returns the integration code of the selected option for a picklist, multi-picklist, checkbox group, or radio buttons. When multiple options are selected, returns an array of integration codes.