To define a rule
-
From the appropriate definition form you want to define
a rule for, press Define (F6) and
choose Rules. For example, if you want to define a file rule, from
the File Definition form, press Define (F6) and choose Rules.
If the file has subtypes, an intermediate form listing the subtypes displays.
-
Select global to apply the rule across the entire file
- or -
-
Select a subtype to apply the rule only to that portion of the file
When defining event rules, you can press the right arrow to move to the Rules column, which automatically displays the Rule Definition form. The same holds true for the subtype listing; you can use the right arrow key to move to the Rules column.
-
-
On the Rule Definition form, press Select (F4) or Define (F6) and choose Rule.
The Select A Rule subform appears. This subform displays different rules depending on whether you are defining file, state, or event rules, and whether those rules apply to the file or to a subtype.
-
Select and define a rule.
Rule Description Add Available only for events. Adds to a field either a constant value or a variable value from a field. For more information, see Add.
Format:
Add FieldA To FieldB
FieldA: The field whose value you want to add to FieldB.
FieldB: The field you want the FieldA value added to.
Assign Assigns a constant value, a variable value from a field, or the current date to a field. For more information, see Assign.
Format:
Assign FieldA To FieldB
FieldA: A field (variable value), a constant value, or the current date.
FieldB: The field you want the FieldA value assigned to.
The procedure for assigning a value to a field follows this table.
Auto Sequence Available only for events. Updates a numeric field with the next sequential number. For more information, see Auto Sequence.
Format:
AutoSeq FieldA Using FieldB
FieldA: The field you want to sequence automatically.
FieldB: The field used to sequence FieldA.
Default Assigns a default value to a field. For more information, see Default.
Format:
Default FieldA To FieldB
FieldA: The field you want defaulted.
FieldB: The field or the value used to default FieldA.
Field Relation Defines relationships between fields. For more information, see Field Relation.
Format:
FldRel(Condition)
Message
Condition: The condition you want tested. Select a condition from the Select A Condition subform, or select New Condition to define a new condition. For instructions on defining a new condition, see Defining Conditions.
Message: The message you want displayed if the condition is not true.
Invoke Available only for events. Executes another event. For more information, see Invoke.
Format:
Invoke Relation Event
Relation: The relation or file you want to invoke. Select a relation from the Select A Relation subform, or select Unrelated Add to invoke an Add event from an unrelated file. If you select Unrelated Add, select a file from the Select A File subform.
Event: The event you want to invoke. If you selected Unrelated Add as the Relation, this field defaults to the Add Edit event.
Make Transition Available only for events. Takes the records processed by an event to a different state. For more information, see Make Transition.
Format:
Make Transition To StateName
StateName: The state you want to make a transition to.
No Entry States that a field must be blank. For more information, see No Entry.
Format:
Field Can't Be Entered
Field: The field a user cannot type a value in.
Reference Restricted Prohibits access to all records in a subtype. For more information, see Reference Restricted.
Format:
RefRstr
Message:
Message: The message you want displayed if the subtype is referenced.
Required Ensures that the user types a value in a field. For more information, see Required.
Format:
Field Is Required
Field: The field a user must type a value in.
Subtract Available only for events. Subtracts from a field either a constant value or a variable value from a field. For more information, see Subtract.
Format:
Subtract FieldA From FieldB
FieldA : The field whose value you want to subtract from FieldB.
FieldB : The field you want the FieldA value subtracted from.
Update Updates numeric, signed, or percent fields. For more information, see Update.
Format:
Update FieldA Using FieldB
FieldA: The field whose value you want to update.
FieldB: The field whose value you want to use to update FieldA.
- Press Enter twice.