Examples of validation rules

Here are a few examples of typical validation rules:

Example 1: Find and correct errors in a Total field

You want to make sure that the sum a customer wrote in a field called Total is correct, and change it if it is incorrect. Total is supposed to match the total of a series of fields called Prices.

  1. Create a validation rule for Total. The condition for FORMS to evaluate is "Sum(Prices) = Total".

  2. For the action, select Set field value.

  3. Click False, since the action is to be taken only if the evaluated expression is false.

  4. As the field name, select Total from the list, because that is the name of the field to be changed if its value is incorrect.

    The expression to type is "Sum(Prices)" This assigns the sum of the Prices fields to the field called Total.

  5. Click Next and save the rule.

Example 2: Use the value of a specific field to send some forms to a queue

A financial institution is processing forms from customers requesting a credit limit increase. Forms requesting a credit line of more than $25,000 must be processed by a senior manager. This could be accomplished as follows:

  1. Create a validation rule for the amount field. The expression for FORMS to evaluate is "Amount > 25000".

  2. For the action, select Set queues.

  3. Click True, since the action is to be taken only if the evaluated expression is true.

  4. In the new dialog, select (for example) Queue 1. Click the arrow to move that queue to the Add queue box.

    If the amount is more than $25,000, the field (and the form to which it belongs) is placed in queue 1.

  5. Click Next and save the rule.

  6. For the senior manager, you create a job description which only that user can run. In the Select queues dialog for the Verify and Transfer job descriptions, you select Queue 1. All other forms are thereby excluded from the job description.

The forms with amounts up to $25,000 are processed normally. No special step must be taken to exclude them from the job description, because forms in queues are inaccessible to Verify and Transfer unless specifically requested.

A different way to do this is by creating event handlers to assign and remove queue numbers.

Adding validation rules to forms

Editing an existing validation rule

Changing the order of validation rules