Parameter | Description |
---|---|
iField | Number of the column in the table |
Property Integer Field_Value_Table
Write Access: | Set Field_Value_Table iField to IntegerVariable/Value |
If a column needs to be validated against one of two values, a limited set of values, or a range of values, you can use the checkbox (see Field_CheckBox_Values), range (see Field_Value_Range) or check (see Field_Value_Check) validations.
In many cases, you will find that these types of validations are too limited for your needs. In such a case, you may use column validation tables.
Set Field_Value_Table Field Customer.Status to oStatusTable
Using a validation table has the following advantages:
When a validation error occurs, the error number and text specified for the column in the Field_Error property are used to report an error. If no text was defined, a standard check-error text will be reported.
The use of validation tables provides tremendous flexibility. They will be discussed in greater detail in Using Validation Tables. For now, we will introduce the primary validation-table classes:
This class allows you to maintain a list of valid values.
Object oStatusTable is a ValidationTable Procedure Fill_List Send Add_Table_Value "O" Send Add_Table_Value "C" Send Add_Table_Value "D" End_Procedure End_Object
This class allows you to maintain a list of valid values and their associated descriptions.
Object oStatusTable is a DescriptionValidationTable Set Table_Title to "Customer Status" Procedure Fill_List Send Add_Table_Value "O" "Opened" Send Add_Table_Value "C" "Closed" Send Add_Table_Value "D" "Flagged for Deletion" End_Procedure End_Object
This class allows you to maintain a list of values and descriptions that can be easily loaded from a specified DataFlex table.
Object Status_Table is a FileValidationTable Set Main_File to CustStat.File_Number End_Object
This class allows you to load your data and description values from the DataFlex Code List.
Object oStatusTable is a CodeValidationTable Set Type_Value to "Status" End_Object
Any of the above validation tables can be linked to a column with the Field_Value_Table message in a data dictionary.
Set Field_Value_Table Field Customer.Status to oStatusTableSee Also
Defining Data Dictionary Field Attributes | Using Validation Tables