Validation Module DBXREF

Purpose:

Search external database and display a Pick List Grid. Replace data once a selection from the Pick List Grid has been made.

Usage:

DBXREF("dbfname","alias","index",search value,"prompt","expression")

 -OR-

DBXREF("dbfname","alias","index",search value,"prompt","~filename")

  • dbfname is the absolute or relative [from ImageMaster home] path to the dBase 3,4, or FoxPro database to be searched enclosed in quotation marks as indicated above.

  • alias is a user defined alias used to reference the searched database on subsequent calls. If an alias is specified, the system will not close the database upon exiting the function. If no alias is specified ("") then the database WILL be closed after the function terminates.

  • index is a REQUIRED index TAG or filename. (see below)

    • "TAG tagname": The tag "tagname" will be selected from the structural CDX associated with the database.

    • "indexname": The absolute/relative (as in dbfname) path to a corresponding .NDX or .IDX index file.

  • search value is the value to be searched, which can be the name of a field (preceded by "m1") or an expression.

  • prompt is column title for the Pick List.

  • In single FRE mode, expression is the actual FRE enclosed in quotation marks as indicated above.

  • In multiple FRE mode, filename is the name of the file that holds the FRE expressions as previously described. The filename should be enclosed in quotation marks and preceded by a tilde (~) as indicated above.

Field Replacement Expressions (FREs) control what data is copied from the matching record. If a single field is going to be updated, the FRE can be placed directly within the command in the Configurator. If multiple fields are going to be replaced, a text file containing all of the FREs (one per line) must be created first.

A typical field replacement expression (FRE) is constructed as follows:

m1fieldname2=fieldname1

m1 is the mandatory prefix to indicate a field in the Data Entry Screen.

fieldname2 is the Data Entry Screen field name in most cases, fieldname1 and fieldname2 are the same.

fieldname1 is the database field name or expression that is the source of the data.

Multiple FREs can be stored in a file placed for convenience in the network Image-Master directory. Choose a name that follows the 8.3 naming convention and an extension of .TXT for ease of administration and technical support.

Operation:

The external database is searched by the specified index using the value provided by search value.

A Pick List is always displayed with the selection bar highlighting the nearest match (which may be an exact match or not). Regardless, once a selection from the Pick List is made, the corresponding single FRE or multiple FRE is performed using the selected external database record chosen from the Pick List. The cursor is moved to the next field in the Data Entry Screen.

If a Pick List is displayed, but is closed without a selection being made (by pressing [Escape]), then the Pick List is closed, no FRE is executed, the Data Entry Screen is left unchanged, and the cursor remains in the field being edited.

Refer to the SDBLOOK example for more information on designing and creating the FRE expression or the FRE expression file.


Related Topic

Validation Modules Introduction