Standard Rule Tab - Use Code Function

The Use Code function enables you to match an element, field, or TFD against a predefined code table and specify whether or not a compliance error is generated if the map component does not contain one of the values in the code table. This function also allows you to store a code’s description in another element, field, or TFD.

You can also create a unique code table, use code values from a code table, and flag whether or not the system generates an error if a validation against the code table fails. You can import and export code lists and copy and paste code lists between maps.

Sterling Gentran:Server® enables you to create code tables to be used with the current map or form. You can set up code tables to function like the partner cross-reference and lookup tables in Sterling Gentran:Server. However, code tables that are set up in the Application or Forms subsystem can be used only for the current map or form. Code tables that you create in Sterling Gentran:Server can be used globally for all maps/forms.

Code List Tables are used by EDI standards as repositories for lists of codes. Each EDI standard provides a code list for each element that can be further defined with a code. Sterling Gentran:Server allows you to load code lists from the standard. You can either load all the codes in the table, or you can select only one or more codes from the table. Once you load a code table, you can use a "Use Code" standard rule to either look up a value from a code table or validate the contents of an element, field, or TFD against the values in the code table.

A element, field, or TFD with a Use Code rule enables values to either be checked against or selected from the codes in a specified code table. Codes are typically used to further qualify another element. For example, if the XX element contains address information, you can further qualify that element by choosing the code "SU" from the 0222 table. In the 0222 table, the code "SU" is described as a "supplier's address." Therefore, by using this code with the XX element, you are indicating that the XX element is not just address information, but address information for the supplier.

Table 1. Standard rule tab (Use Code) parts and functions
Part Function
Code list Contains all the code tables. If the necessary code table is not listed, click Edit to load or create a code table.
Edit Accesses the Edit Code List dialog box, which enables you to add, edit, delete, and load code list tables.
Raise compliance error Indicates that, for compliance reasons, the element, field, or TFD must contain one of the codes from the specified table (nothing else is valid for that field).

For example, if a field is defined as containing only YES or NO, you can set up an exclusive code table that contains only YES and NO. Then if you receive a MAYBE in that field, the system flags it as an error.

Code description Contains the element, field, or TFD where you want the description of the code that is used to appear when the selection is made.

For example, if the code is SU, it is much more useful to view the description of the code (Supplier's Address). If you selected element XX from the store description list, the description for the code used is mapped to element XX.

Table 2. Edit Code List dialog box parts and functions
Part Function
Table list Specifies the table identifier.
New Accesses the Edit Code List dialog box, which allows you to create a new code list.
Change Accesses the Edit Code List dialog box, which allows you to edit the selected code list.
Delete Deletes the selected code list
Import Accesses the Open dialog box, which allows you to import a code list.
Export Accesses the Save As dialog box, which allows you to export the selected code list.
Copy Copies the selected code list.
Paste Pastes a previously-copied code list in a map.
Table 3. Edit Code List dialog box parts and functions
Part Function
Table ID Contains the name of the field or element for which this code list table is used.
Desc Contains the description of the field or element for which this code list table is used.
Allowed Codes Specifies the codes that are allowed for this table.
New Accesses the Edit Code List Entry dialog box, which allows you to create a new code.
Change Accesses the Edit Code List Entry dialog box, which allows you to edit the selected code.
Delete Accesses the Edit Code List Entry dialog box, which allows you to delete the selected code.
Load Accesses the Load Code List dialog box, which allows you to select, from a standard code table, specific codes that you want to load or select the entire list of codes.
Table 4. Edit Code List Entry dialog box parts and functions
Part Function
Value Specifies the actual value of the code.
Description Contains the code value description.
Note: The description is used if you specify an element or field (in the Store Fields list on the Field Properties dialog box) to which you want the code description mapped.