Validations

Top  Previous  Next

Validations are executed via the validations object, and are found in validations.ini and validations.custom.ini.  They are implicitly run by job designs, or can be run by any custom code, including other validations.  Validation routines are designed to test and confirm the validity of a value, such as ensuring a customer ID exists in a customer table, or that column total matches a form total.  The routine tests the value in any way needed, and if there is a problem, it sets errmsg$="some message".  The presence of a message in that variable indicates the validation failed.

 

When validations are executed by jobs, this pass/fail result is managed for all the fields and identification values that have a validation configured.  Documents with invalid values cannot be transferred to an archive library, and the Image Manager interface highlights and displays the problems found on the document.

 

Validations can also have side effects that can be beneficial, such as updating properties in a inbounddoc object presented as the doc variable.  For example, a validation that tests the existence of a customer record can also update an associated customer name field on the document.

 

When a doc object is available and has a jobname$ property assigned (which is automatic when run in a job execution context), then that job's parameters are used to pre-create "param.name$" variables for each parameter.

 

Validations provide three settings:

 

description is a text value that is displayed in job design.
 
parameters is a comma-separated list of parameter names.  When the validation is run, it should be supplied these parameters either as an associative array or in the name structure, as described in the validations object documentation.  When run within an Image Manager design, these parameters are supplied by the designer.
 
types is a list of field or zone types this filter logically applies to.  The Image Manager will use this value to display appropriate options when looking up validations during job design.