Validation Clause Expressions

Overview

Image-Master uses Validation Clause Expressions to reduce errors during data entry. There are two types of validation expressions:

  1. Validation Clause Expression – Assigned in the Index Field Editor, these are evaluated in the Scanning Module at the time of entry.

  2. Scan Set Validation Expression – These are assigned in the Global Settings dialog box. They are evaluated in the Scanning Module when a scan set is saved to the disk.

Validation Clause Expressions are logical expressions that will evaluate either True or False.

  • If the validation expression evaluates True, then the entry is accepted.

  • If the validation expression evaluates False, the entry is rejected.

To use this expression, it is helpful to have some prior experience using FoxPro expressions. This section provides basic guidelines. When you enter a value in a field, the field is referenced by a variable. The variable holds the value until it is saved to the image database.

The variable is named m1 + fieldname. For example, if the field name is COMP (Company), the variable will be m1COMP. The validation expression for a field must contain the m1 variable to validate the field.

All of the FoxPro logical expressions can be used as validation expressions.

Here are some examples of validation expressions.

NOTE: The COMP fieldname is used for demonstration purposes.

NOTE: The dots that enclose the AND & OR operators are optional in Image-Master 7x and above, but mandatory in Image-Master 6x.

NOT EMPTY (m1COMP) – Validation ensures that this field is not blank.

m1COMP> = "A" .AND. m1COMP < = "Z" – This ensures that m1COMP values fall within a specified range of values.

Common Operators Used in Validation Expressions

= Equals
> Greater than
>= Greater than or equal to
Less than
<= Less than or equal to
# Not equal to
.AND. Logical AND
.OR. Logical OR

Date Fields can now be configured to accept two-digit year entry, assuming the current century.

  1. Start Image-Master and select [Database Configuration].

  2. Select your desired database.

  3. Select [Index Field Editor].

  4. Click on your desired field and click on the icon next to the Validation / Field Level Event Expression field.

  1. Set your desired validation expression in the Expression Builder.

  1. Select [OK] to close the Expression Builder.

  2. Select [OK] to close the Index Field Editor.

Validate Character Date Format

This validation clause that takes an 8-character string and determines if it represents a valid date given the specific format of YYYYMMDD where:

YYYY=Year (rng 1000-3000)
MM= Month (rng 1-12)
DD= Day (rng 1-31, 1-30, 1-29, 1-28 based on month & leap year)

It returns True=valid date or False invalid date.

To utilize:

  1. Deploy "F:\EIDMS\Validation Modules7\ISADate.FXP" to network IMASTER folder.

  2. Configure source field (Default Value) to be SPACE(8) and in Picture clause 99999999 (to enforce numbers and max length).

  3. In validation / Field Level Event Expression, enter ISADATE(m1fieldname) where m1 is a literal and fieldname is the actual name of the source field.


Related Topic

Introduction to Advanced Features