About validators

Windows client provides an extensive facility for validating values in components. Windows client validators are global objects that can be reused by multiple components and forms. You can associate one or more validators with a component.

Windows client validators support a set of behaviors that allow for very efficient processing of the component. For instance, you can set up a validator that is related to the component list source in such a way that any value matching an item in the list is automatically considered valid. In many cases, this technique can eliminate round trips to the server for checking. Moreover, you can set up validators that both validate a value and also return output values to the form for functions, like displaying associated descriptions or setting down-stream component defaults. This technique also eliminates round trips to the server.

Validating immediately

Validators can be set to execute as soon as a user selects something from a list or exits a component; or they can be deferred until the user attempts to navigate to a different IDO item in the collection or to save the form. To make a component's validators execute as soon as the user selects from a list or exits the component, set the Validate Immediately property.

Validating data changes

You can use validators to verify that a data change is valid. Data changes can include the addition, modification, or deletion or data in a component. A validator can be set up to check entries made by users and verify that the changes are OK. If the validator fails, then the changes is not allowed to go forward.

Validator messages

You must specify an error message for all validators. You can specify an existing Windows client string or create your own message string for the error message.

See Message strings.

You can also display the text of validator exception messages as error messages by selecting the Exception text is Back End Msg parameter.

Validator dependencies

Previously validated data can become invalidated because some value on which the validation is dependent has changed. A validator's specification may reference a component, a variable, or a property value. If this value changes subsequent to validating the component, the component is marked as not validated. In this case, the validator executes again if the user tabs through the component or saves the form.