Working with validation rules in the DataWindow painter

Validation rules you assign to a column in the Database painter are used by default when you place the column in a DataWindow object. You can override the validation rule in the DataWindow painter by defining an ad hoc rule for one specific column. You define ad hoc rules in the Column Specification view.

What you do in the DataWindow painter

In the DataWindow painter, you can:

Figure 21-11: Specifying a validation rule in the DataWindow painter

The sample displays the Column Specification view of the Data Window painter. It lists three column names. The third row displays the column Name Salary. Its data type is listed under the Type column as decimal ( 3 ). For Salary, the initial value displayed is 3000, the Validation Expression is real ( get text (  ) ) greater than 0, and the Validation Message is " Sorry ! The value must be greater than zero. "

StepsTo specify a validation rule for a column in the DataWindow painter:

  1. In the DataWindow painter, select View>Column Specifications from the menu bar.

    The Column Specification view displays.

  2. Create or modify the validation expression.

    To display the Modify Expression dialog box, right-click the cell under the Validation Expression column that corresponds to the column for which you are creating or modifying a validation rule, and select Expression from the pop-up menu. Follow the directions in “Specifying the expression”.

  3. (Optional) Enter a string or string expression to customize the validation error message.

    To display the Modify Expression dialog box, right-click the cell under the Validation Expression column that corresponds to the column for which you are creating or modifying a validation rule, and select Expression from the pop-up menu. For more information, see “Customizing the error message”.

  4. (Optional) Enter an initial value.

    NoteUsed for current column only If you create a validation rule in the DataWindow painter, it is used only for the current column and is not saved in the extended attribute system tables.