Flex Code Definitions

A flex code definition represents a domain of values. Flex code entity is one such value.

The purpose of such a domain is to bind the values of a Field Definition.

For example, to specify a dynamic field that can either have the value Yes or No; that is controlled through a flex code definition that has a flex code Yes and a flex code No.

A flex code always has a start and end date, and the definition to which it belongs.

Flex Code Definition Overview

The image above shows the example of a flex code definition that stores a member’s occupation.

A flex code definition has the following attributes:

Field Description

Code

The identifying code of the flex code definition

Description

A description of this flex code definition

A flex code definition has one or more flex code field usages. Each flex code field usage represents a column on a flex code. A flex code field usage has the following attributes:

Field Description

Name

The unique name of the column (within the code) in the object model

Display name

The column header when the codes are shown in a table view

Display sequence

The column position when the codes are shown in a table view

Field

The data type, length, decimals and other validations that apply

Key?

If checked, then this field is the flex code key field.

Descriptor?

If checked, then this field is the flex code description field.

Mandatory?

If checked, then this field is mandatory for each flex code.

Allowable values

References another flex code definition. The value of this field must be one of the available key field values of the referenced definition.

The following paragraph explains how to set up a flex code definition as shown in the image above.

  • Code: OCC

  • Description: Occupation

For each possible occupation two fields are stored: the key, which is a four-digit code, and a description, which is a 60 character field. For this purpose, the payer creates two flex fields:

  • Code: C4, Data type: char, Length: 4

  • Code: C60, Data type: char, Length: 60

The last step is to specify the flex code fields, connecting the flex code definition with the flex fields. The payer creates the following two flex code field usages for the POS flex code definition:

  • Code: "occCode", Display name: "Occupation", Display sequence:0, Flex field:C4, Key?: checked, Mandatory?: checked.

  • Code: "occDescr", Display name: "Description", Display sequence:1, Flex field:C60, Description?: checked, Mandatory?: checked.

Now to set up a complete definition. The next step is to set up the flex codes within the system. these are the actual values. The system imposes the following business rules:

  • Only one field usage can represent the key field.

  • Only one field usage can represent the descriptor field.

  • The key field is always mandatory.

  • The key field is always the first field that is displayed (display sequence 0).

  • The descriptor field is always the second field that is displayed (display sequence 1).

  • Alphanumeric fields (including the key field) can be up to 1000 characters long.

  • Once flex codes exist for a definition, it is no longer allowed to update the Key? indicator or the Allowable Values field. [1]. [2].

  • Once flex codes exist for a definition, it is no longer allowed to create new key and/or descriptor fields.

  • The flex field that represents the key field must be of the character data type.

  • The 'allowable values' attribute may only be set for non-key, non-descriptor fields.

The start and end date on a flex code represent the time during which the flex code is a valid value within the flex code definition. Flex codes within the same definition have the same key field cannot overlap in time.


1. The system allows setting the Mandatory? indicator even if flex codes exist. Setting the field to mandatory does not check if all current flex codes currently have a value. The check however applies when the flex code or the record that holds the flex code is updated
2. The system allows updating the Field Code. The system only allows updates to field code of the same datatype (CHAR to CHAR, and so on) and an equal or bigger size. A field definition can have a validation logic (see Field Definition page of this chapter. Changing the field code for a flex code will not check if all current flex codes meet the validation condition of the new field definition. The system however checks that validation logic when the flex code or the record that holds the flex code is updated