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.
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."
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.
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.
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:
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:
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.
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.
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):
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:
Error segment: Department? Account?
Here's how to express your control objective more clearly using two rules:
Error segment: Department
Error segment: Account
Maintaining Your Cross-Validation Rules and Valid Combinations
Cross-Validation Rules Window
Defining Cross-validation Rules
Defining Cross-validation Rule Elements