Defining Rules

Rules let you assign values to non-input fields on a form. When you run the program, it moves the values you enter on the form to the database. You can define global rules or event rules for a form.

Global rules, also called form rules, govern the data on a form, regardless of the event you are in. You can define global rules only for Add or Change events. If a field is not an input field, you can assign a value to it when you define the form Add or Change event.

Event rules govern the data on the form only when you are in a specific event. You can assign values only to database-type fields. The value can be a value from another field or a constant value. You can also assign the current date to a date field, and the current time to a time field.

When the program creates or updates the record, it moves the value you assigned to the non-input field to the database. These field assignments are called event rules.

You define form (global) rules from the Format form and event rules from the Form Action Definition window. In the Form Action Definition window, EvtAsn appears on the line beneath the Form Action Events heading when you select a form action event that has form rules.

To define rules

  1. To define global rules for a form, on the Format form, press Define (F6) and choose Rules.

    - or -

    To define event rules for a form

    • On the Format form, press Define (F6) and choose Events.

    • In the Form Action Definition window, select the form action event for which you want to define rules.

    • Press Define (F6) and choose Event Rules. You can define event rules for events with an Add, Change, or Function type.

  2. On the Form Rule Definition form, press Select (F4) and select the target fields (that is, the fields to which you want to assign a value). The system assigns spaces to alpha-type fields and zeroes to numeric-type fields.
  3. To assign another field, a constant value, the current date, or the current time to the target field, select the rule you want to change and press Define (F6).
  4. From the Define menu, choose one of the following options.
    Choose To
    Field Assign a variable value (field) to the field.
    Value Assign a constant value to the field. The Select A Value window or the Value window appears. Select a valid value or type the constant value, then press OK.
    Current Date Assign the current date to the field.
    Current Time Assign the current time to the field.
  5. Press OK twice.