Form events reference

Form Studio includes a Groovy-based validation framework for form events. Form developers can specify groovy script validations on events such as loading and submitting forms.

Note: For instructions on creating scripts, see the Infor Workforce Management Custom Scripting Developer Guide.

Form developers can use Groovy script validations to create these form events:

  • On Load: An On Load event occurs whenever the user loads the form.
  • On Validate: An On Validate event occurs whenever the user clicks Submit to process the form or clicks Next on a multiple page form.
  • On Change: An On Change event occurs multiple times on a form based on changes made to designated controls that have the Validate On Change check box selected.
These API methods are available for Groovy script validations:
  • onLoad: This validation is performed when the form is first loaded.
  • onValidate: This validation is performed when the form is submitted.
  • onChange: This validation is performed when changes are made to designated controls that have the Validate On Change check box selected.
  • getFieldValue: This method is used to retrieve a value of a given field by its name.
  • setFieldValue: This method is used to set a value of a given field.
  • setFieldErrorMessage: This method is used to set an error message to a given field by its name.
    Note: Field level error messages are displayed next to the field for which the error message occurs.
  • addErrorMessages: This method is used to add a general (not applicable to any field in particular) error message that is displayed in a pop-up.
  • setFieldReadonly: This method is used to set a read-only flag of the field identified by name.
    Note: Use setFieldReadonly(String fieldName, boolean readOnly) where
    • @param fieldName {@link String}: Is the name of a form field for which the read-only is set
    • @param readOnly {@link boolean}: Is the value of the parameter
    • @throws PublException: If the field with given fieldName does not exist
  • fieldExists: This method is used to verify the existence of a specified field within the form.
  • getFieldTextValue: This method is used to retrieve the label text value of a DBLookup field.