Previous  Next          Contents  Index  Navigation  Glossary  Library

Rules

You set up cross-validation by specifying rules that describe valid combinations for key flexfields. You can define new cross-validation rules anytime using the Define Cross-Validation Rules form. Your rules are effective only while you have Cross-Validate Multiple Segments set to Yes in the Define Key Flexfield Segments form.

Each cross-validation rule contains one or more rule elements, where each element is a key flexfield range that specifies low and high values for each segment. You identify a rule element as either Include or Exclude. Include means include all values in the specified segment ranges, and Exclude means exclude all values in the specified segment ranges. Every cross-validation rule must contain at least one Include rule element. Exclude rule elements override Include rule elements. See: Key Flexfield Segments, Cross-Validation Rules.

Determine Your Error Messages

You can define your own error messages for your validation rules. Define error messages to explain errors to users. Your flexfield automatically places the cursor next to the value your user needs to change to correct the error. Define error messages based on the frequency with which key flexfields errors are made.

For example, if you use the Accounting Flexfield, you might have a rule preventing revenue account values (values between 4000 and 9999) with the balance sheet department value 000. An incorrect combination can result from the user entering an incorrect department or an incorrect account. Maybe you intended to enter 100-4500 instead of 000-4500. Or, maybe you intended to enter 000-3500.

If you expect that most of the time the account will be wrong, define an error message such as, "Enter only balance sheet accounts with department 000." If you expect that most of the time the department will be wrong, define an error message such as, "Enter departments other than 000 with revenue accounts." If you expect that either segment is just as likely to be incorrect, define an error message that does not imply a particular segment is in error.

For example, "You have entered an incompatible department/account combination. Please re-enter."

Determine Your Error Segment

Determine in which segment you want to place the cursor when a key flexfield combination fails a validation rule. Choose the segment you feel will most likely be in error. If you have defined a good error message, the message and the segment to which the cursor returns should correspond.

For example, if your account segment is most likely to be in error, define your error message to be, "Please enter only balance sheet accounts with department 000," and specify the cursor to return to the account segment.

If either segment is as likely to be in error, specify the cursor to return to the first of the two segments. If the second segment is actually the one in error, it is more intuitive to move down to a subsequent segment than it is to move back to a previous segment.

Define Simple Rules

Avoid rules that control cross-validation across more than two segments, where possible.

For example, if you use the Accounting Flexfield, you may want to prevent using department 000 with accounts greater than 3999 for all balancing segment values except 99.

While you can define cross-validation rules that span two or more segments, keep in mind that it becomes more difficult to interpret cross-validation error messages and correct invalid key flexfield combinations as your rules encompass more segments.

Using Include and Exclude Ranges

Consider the following basics of cross-validation rules:

In summary, a key flexfield value must fall within at least one include range and outside all exclude ranges to pass your validation rule.

Using Include Ranges

Accomplish your control objectives primarily with include ranges when you have a stricter structure for your key flexfield structure. With include ranges, you list valid combinations instead of invalid combinations.

For example, if you use the Accounting Flexfield and want to allow users to enter only certain balancing segment values with certain products or projects, you can enumerate the possibilities:

Include: From 01-100
  To 01-199
Include: From 02-200
  To 02-399
Include: From 03-500
  To 03-699

Using Exclude Ranges

Accomplish your control objectives primarily with exclude ranges when your key flexfield structure is less structured and your key flexfield segments do not have a lot of interdependencies. In this situation, you generally want to accept most combinations. You just want some exceptions to this general rule.

For example, if you use the Accounting Flexfield and want to prevent users from entering balancing segment values 01 and 02 with departments greater than 899, you can specify this exception:

Include: From 00-000
  To 99-999
Exclude: From 01-900
  To 02-999

Minimum and maximum possible values

The lowest and highest possible values in a range depend on the format type of your value set. For example, you might create a value set with format type of Number where the user can enter only the values between 0 and 100. Or, you might create a value set with format type of Date where the user can enter only dates for the current year (a range of 01-JAN-93 to 31-DEC-93, for example). For example, if your format type is Char, then 1000 is less than 110, but if your format type is Number, 110 is less than 1000. The lowest and highest possible values in a range are also operating system dependent. When you use a Char format type for most platforms (ASCII platforms), numeric characters are "less" than alphabetic characters (that is, 9 is less than A), but for some platforms (EBCDIC platforms) numeric characters are "greater" than alphabetic characters (that is, Z is less than 0). The window gives you an error message if you specify a larger minimum value than your maximum value for your platform.

As discussed below, you can use blank segment values in your rules to make rules easier to define and maintain. A blank segment value means you want to include or exclude "all the way to the end" of the range (either minimum or maximum).

Suggestion: Use blank segments to specify the minimum or maximum possible values for a range to avoid having operating system dependent rules.

Using Blank Segment Values

Blank segment values in your rules make the rules easier to define and maintain. A blank segment value means you want to include or exclude "all the way to the end" of the range (either minimum or maximum).

If you leave a low segment blank, the minimum value for your Include or Exclude range is automatically the smallest value possible for your segment's value set. For example, if the value set maximum size is 3 and Right-justify Zero-fill Numbers is set to Yes, the minimum value is 000. However, if the value set maximum size is 3, Alphabetic Characters is set to No, and Right-justify Zero-fill Numbers is set to No, the minimum value is 0.

If you leave the high segment blank, the maximum value for your Include or Exclude range is automatically the largest value possible for your segment's value set. For example, if the value set maximum size is 3 and Alphabetic Characters is set to No, the maximum value is 999. However, if the value set maximum size is 5, and Alphabetic Characters is set to No, the maximum value is 99999.

Note that a blank segment value (null value) is considered to fall within a range that has one or both ends specified as a blank. However, if each of your segments require a value, you would not be able to create a combination with a blank segment anyhow.

You may use blank minimum or maximum segment values to create cross-validation rules that can test for blank segments (that are not already required to have a value). For example, if you allow a null value for your last optional segment but not the second-to-last optional segment, you would use a blank minimum or maximum value for the last segment but fill in a value (such as 000 or 999) for both the minimum and maximums for the second-to-last optional segment.

Using Blank Values in Your Ranges

You may create cross-validation rules for flexfield structures where you allow users to leave some segments blank (that is, where you set the Required field to No for one or more segments in a flexfield structure using the Define Key Flexfield Segments window). You may also create cross-validation rules for flexfield structures where you do not allow users to leave any segments blank.

Often you want to control the values in just one or two segments, and any valid segment values may be used in the remaining segments. For example, if you have a six-segment Accounting Flexfield of the form 00-000-0000-000-000-0000, you may want to allow (include) all possible combinations where the first segment contains 01 and the second segment contains values between 200 and 299, inclusive. You can specify the minimum and maximum values for each segment as follows (assuming that only numeric characters are allowed for these segments):

Include: From 01-200-0000-000-000-0000
  To 01-299-9999-999-999-9999

Or, you could use blank values as both the minimum and maximum values for each of the unrestricted segments (the last four segments):

Include: From 01-200-____-___-___-____
  To 01-299-____-___-___-____

Since the blank values clearly signify the ends of the ranges, you may find them easier to use than explicitly specifying the range ending values. Of course, you can always specify only one blank value in a range if the range has one fixed value:

Include: From 01-200-2000-___-___-____
  To 01-299-____-___-299-____

Define Multiple Rules

You should use several simple validation rules instead of using one complex rule. Simple validation rules let you provide a more specific error message and return your cursor to the most appropriate key flexfield segment. Simple rules are also easier to maintain over time.

For example, if you use the Accounting Flexfield, you might want users to enter departments 100 to 199 and asset accounts 2000 to 2999 only for balancing segment value 01. While you can accomplish this objective with one rule, you can see that it is more cumbersome:

Include: From 00-000-0000-000-000-0000
  To 99-999-9999-999-999-9999
Exclude: From 02-100-2000-000-000-0000
  To 99-199-2999-999-999-9999

Error message: Incorrect department or account with this balancing segment value.

Error segment: Department? Account?

Here's how to express your control objective more clearly using two rules:

Rule #1

Include: From 00-000-0000-000-000-0000
  To 99-999-9999-999-999-9999
Exclude: From 02-100-0000-000-000-0000
  To 99-199-9999-999-999-9999

Error message: Please use departments 100-199 only with balancing segment value 01.

Error segment: Department

Rule #2

Include: From 00-000-0000-000-000-0000
  To 99-999-9999-999-999-9999
Exclude: From 02-000-2000-000-000-0000
  To 99-999-2999-999-999-9999

Error message: Please use accounts 2000-2999 only with balancing segment value 01.

Error segment: Account

See Also

Cross-Validation Rules

Maintaining Your Cross-Validation Rules and Valid Combinations

Reports

Cross-Validation Rules Window

Defining Cross-validation Rules

Defining Cross-validation Rule Elements


         Previous  Next          Contents  Index  Navigation  Glossary  Library