If a field needs to be validated as either of two values, a limited set of values, or a range of values, you can use one of the extended validation methods already detailed (checkbox, range, and check). In many cases you will find that these types of validations are too limited for your needs. In such a case you may use a Validation Table to handle field validations. Using a validation table has the following advantages:
You can specify a larger number of valid values than can easily fit within a check string
You can specify and display a description for each value in your list
You can dynamically maintain your list of values (i.e., the values do not have to be coded in your program)
You can choose to make selection from this list optional (i.e., you can display a list of suggested values during data entry, but you are not required to make a selection from the list).
The concept of a validation table is simple.
In your program you must create a validation table object.
This object is then assigned to a field(s) in a Data Dictionary by using the Field_Value_Table message.
Once assigned, the field will use this object as a validation and display resource.
While the concept and usage of validation tables is simple, their benefits are considerable. Because special objects handle the validation and display, it is possible to handle just about any type of list-validation condition. In fact, you could create your own custom validation-table subclasses. It is simply an object containing a list of valid values and, optionally, descriptions that understands a pre-defined message protocol so that DDOs and DEOs may communicate with it.
While you could create your own custom validation subclasses, you will probably not need to. We have provided a series of validation table classes that will probably handle all your needs.
Used to provide a static list of data values
Used to provide a static list of data and description values
Used to acquire validation information from a table of your choosing
Used to acquire validation information from a single, pre-defined Code Validation table
You are most likely to use ValidationTables, DescriptionValidationTables and CodeValidationTables. These tables can be maintained entirely within the Studio’s Data Dictionary Modeler.
The following sections will describe these different types of Validation Tables and explain how you can create your own validation table classes. You can do this by sub-classing one of the existing classes or by building a complete new class.
Creating Your Own Validation Table Classes