Defining Cross-validation Rules

Cross-validation rules control combinations of values within a particular key flexfield structure. Cross-validation applies to combinations users attempt to create using either the combinations form or foreign key forms (using dynamic inserts).

When a user finishes entering segment values in a flexfield pop-up window, the flexfield checks whether the values make up a valid combination before updating the database. If the user entered an invalid combination, a diagnostic error message appears, and the cursor returns to the first segment assumed to contain an invalid value.


Cross-validation Rules and Existing Combinations

Cross-validation rules have no effect on combinations that already exist when you define your cross-validation rules. Suppose you define a new cross-validation rule, but have existing entries in your combinations table that violate the rule. Since the existing combinations pre-date the rule, your flexfield continues to treat them as valid. However, if your end user tries to create a new combination that violates your new rule, your flexfield returns an error message and rejects the combination.

If you want to prevent users from using previously-existing combinations that are no longer valid according to your cross-validation rules, you can always manually disable those combinations using the combinations form. 


Dynamic Insertion and Cross-Validation

Your use of cross-validation is separate from (and in addition to) your use of dynamic inserts. By allowing dynamic inserts, you can let users create new combinations automatically upon entering the combination in a foreign key form (any form other than the combinations form) and in the combinations form itself.

If you want greater control, you can disallow dynamic inserts. You can thus restrict the creation of new combinations to certain authorized people who have access to the combinations form on their menu. You simply turn dynamic insertion off using the Define Key Flexfield Segments form. Depending on the key flexfield you use, you can still create new combinations using one of your product setup forms (the combinations form). For example, if you use the Accounting Flexfield, you can enter new combinations using the Define Accounting Flexfield Combination form.

As you consider the controls you want over your key flexfield combinations, determine whether you need cross-validation rules at all. To provide an extra level of security, use cross-validation rules even if you turn dynamic insertion off. This allows you to double-check new combinations that even your authorized personnel enter using the combinations form.


Changing your key flexfield structure after defining rules

Changing an existing key flexfield structure may adversely affect the behavior of any cross-validation rules you have for that structure, so you should be sure to manually disable or redefine any cross-validation rules to reflect your changed structure. Flexfield structure changes that make your existing rules invalid include:

  • Changing the order of segments
  • Adding a new segment
  • Disabling a segment
  • Changing segment lengths
For example, if you change a six-segment structure to contain only five segments, you would not be able to use any new five-segment code combinations since any rules existing for the old six-segment structure would be violated. 


Defining Cross-Validation Rules

Responsibility: System Administrator

Navigation:  Application --> Flexfield --> Key --> CrossValidation

1. Select the name and structure of your key flexfield for which you wish to define cross-validation rules. Your list only contains structures with the field Cross-Validate Multiple Segments set to Yes on the Key Flexfield Segments window.



2. Enter a unique name and a description for your cross-validation rule.

3. Enter your error message text for this cross-validation rule. Your flexfield automatically displays this error message on the message line whenever a new combination of segment values violates your cross-validation rule. You should make your error messages as specific as possible so that your users can correct any errors easily.

4. Enter the name of the segment most likely to have caused this cross-validation rule to fail. Your flexfield leaves the cursor in this segment whenever a new segment combination violates this cross-validation rule to indicate where your user can probably correct the error. If you do not specify an error segment name, your flexfield leaves the cursor in the first segment of the flexfield window following a violation of this rule.

5. If you want to have the rule effective for a limited time, you can enter a start date and/or an end date for the rule. The rule is valid for the time including the From and To dates.6. Define the cross-validation rule elements that make up your rule. 

7. Save your changes.

No comments:

Post a Comment