Validating Field Values

For many situations, you might want to place limits on the values the application will accept for numeric fields on a form.

Example

A budget transfer might move monies from one CBS code to another. In this situation, the transfer must show a net zero amount. For this case, you would want to validate the amount field to verify that it equals zero. At runtime, the application will validate the value in the amount field and display an error message if the value exceeds zero.

For some situations:

Example

For a list of five check box items, you might require users to check at least three out of the five. So for validation, you could include a hidden field on the form containing a formula that adds the value of each check box (checked = 1, unchecked = 0). If the value of this hidden field is less than 3, then the user will not be allowed to leave the form. By data definition, check boxes are integers, and you cannot place a formula on an integer field; however, you can use integer fields in formulas. The hidden field in this example must, therefore, be a decimal field that holds the total value of the check boxes. That decimal field must be greater than or equal to 3 for this validation. At runtime, the application will validate the value in the hidden field and display an error message if the value is not greater than or equal to 3.

You require that the user includes at least one associated attachment.

Example

Submittals are used to track items that are produced by an outside supplier or subcontractor and are delivered to a contractor for use in a project, so Submittals would require to include attachments in the record or line item to support the process. In such cases, you might require users to include at least one attachment. So for validation, you could include a read-only DE on the forms to display the attachment count.

This DE (uuu_attachment_count) can be placed in any form, whether the form allows including attachments or not.

To validate fields, you need to create validation rules and then apply them to the field when you design the form.

To create a validation rule:

  1. Open the form that contains the field you want to validate. The Form Designer window opens.
  2. Click the Validation button in the Designer window toolbar. The Validation Rules window opens.
  3. Click the Add button. A Validation Rule window opens.
  4. In the Name field, enter a name for this rule.
  5. In the Expression field, click the Formula button. The Formula Creation window opens.
  6. On the left pane, double-click the element you want to validate to move it to the right pane. Then click OK to close the window.
  7. In the Condition field on the Validation Rules window, click the down arrow and choose the criteria the field value must meet, such as "Greater than or equal to."
  8. In the Value field, enter the value the field must not exceed.
  9. In the Show this message field, enter the error message the user should see if the field value exceeds the value you specified. You can enter up to 400 alphanumeric characters.
  10. Click OK.

To apply a validation rule to a field:

  1. In the Form Designer window, select the cell containing the field you want to validate.
  2. Click the Validation button on the toolbar. The Validation Rules window opens.
  3. Select the rule you want to place on this field and click Close.


Last Published Monday, June 3, 2024