Skip to content

Field_Value_Table - DataDictionary

Sets the Id of the validation table set up to validate this table column

Type: Property
Access: Write-Only
Data Type: Integer
Parameters: None

Parameters

Parameter Type Description
iField Integer Number of the column in the table

Syntax

Property Integer Field_Value_Table
Access Type Syntax
Write Access: Set Field_Value_Table to IntegerVariable/Value

Description

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.

Use Field_Table_Object to retrieve the Id of the validation table set up to validate this table column.

Sample

Set Field_Value_Table Field Customer.Status to oStatusTable

Using a validation table has the following advantages: You can specify a larger number of valid values than can easily fit within a check stringYou can specify and display a description for each valueYou can dynamically maintain your list of values (i.e., the values do not have to be coded directly in your program)You can make the list choices optional (i.e., you can display a list of suggested values during data entry but users are not required to make a selection from the list) 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:

ValidationTable

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

DescriptionValidationTable

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

FileValidationTable

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

CodeValidationTable

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 oStatusTable

See Also

Defining Data Dictionary Field Attributes | Using Validation Tables