Subtypes

A subtype is a group of records defined by a conditional statement. Subtypes allow you to group similar records within a file under a name and access the records by that name. The subtype name must be unique within a file.

Subtypes also provide a way to assign business rules to data that meet certain criteria. For example, employee hours on a time record form could be categorized into billable or non-billable subtypes. A report could total only billable hours, thus saving time because non-billable records are not retrieved. A rule on the billable subtype requiring a Customer Number would ensure all billable hours are charged correctly. The record would not be added to the file until the employee typed a Customer Number.

For the procedure to define a subtype, see Defining Subtypes and Subtype Rules.

Subtype Example

Accounts Payable invoices can be paid, partially paid, or unpaid. On a paid invoice, the amount paid is equal to the invoice amount. On a partially paid invoice, the amount paid is greater than zero, but less than the invoice amount. On an unpaid invoice, the amount paid is zero. You can define subtypes to access these three groups of invoices. The following examples show three subtypes.

You can define rules for a subtype. Rules defined for a file apply to all records in the file. Rules defined for a subtype apply only to the records in the subtype.