Defining States

A state is a phase of a record's existence. Think of a record's life as a sequence of states. All records in a file have the same sequence of states. Records can, however, go into or leave the sequence at any point, and they can even go backwards. The state name must be unique within the file.

Each file has an initial state, Edit. The Edit state has three default events, Add, Change, and Delete. A state can have only one add- and one change-type event, but as many delete- and function-type events as needed.

Adding a State

The system defines the default state Edit for each file. The system adds records to the file in the Edit state. Though you can change the state name Edit, you cannot delete this default state from the file.

If a file has more than one state, you must select a one-character alpha or numeric field from the file to be the State field. Then, for each state in the file, you must assign a unique value to the State field to represent the state. The value in a record's State field determines the state of the record.

The State And Event Definition form displays the State field in the top section of the form. The value of the State field changes depending on which state you select.

Example

The State field is Status; the value of the State field for the selected state, Active, is 1.