Creating and Updating Data Validation Rules in Forms
Data validation rules are defined by Administrators on the Layout tab of the Form Designer. You can add validation rules at the grid, row heading, column heading, or cell level. Areas on the Layout tab with a green background, indicate locations where rules have been defined.
To create and update validation rules:
- On the Home page, click Navigator
, and then under Create and Manage, click Forms.
- Create or edit a form, and then on the Form and Ad Hoc Grid Management page, click Layout.
-
In Layout, right-click the row, column, or cell, for
which you want to add or update the validation rule. Depending on the location
and whether rules were already defined at that location, you'll see some or all
of the following context menu options:
-
Add/Edit Format/Validation Rules: Create or modify rules for individual data cells or all data cells in a grid, row, or column in the Format/Validation Rule Builder.
-
Copy | Paste Format/Validation Rules: Copy and paste the rules at the selected locations.
-
Add/Edit Format/Validation Rules for Metadata: Create or modify format rules for the row metadata cells or column metadata cells in the Format/Validation Rule Builder.
-
Copy | Paste Format/Validation Rules for Metadata: Copy and paste the rules for row metadata cells or column metadata cells at the selected locations.
-
-
Select Add/Edit Format/Validation Rules to create or
update rules.
Note:
(Add Validation Rule).
-
In the Format/Validation Rule Builder, create a new rule
or update an existing rule.
-
If necessary, move the rule by selecting an option from Location. To create a rule similar to an existing rule, click
(Duplicate) and then update the rule. To view rules in the current location, click View Rule. See Viewing Data Validation Rules.
-
Enable format/validation rule: Select to make the format/validation rule available in forms. You can temporarily disable a format/validation rule by clearing this checkbox.
-
Format Only: Select to mark a rule as format only. This option is automatically enabled when a format-only rule is created. See Creating and Updating Format Rules in Forms.
-
- Update the rule.
-
For Condition, select an option to begin the
condition statement: If, Else
If, Else,
Then, Range,
Check Range, or
Format.
Note:
For the Format condition, the Source Type field will automatically display the Process Cell option. There are no other Source Type options for the Format condition. See About Format Rules in Forms.
For validation rules, the first part of a validation rule must include an If condition. Validation rules must also contain some form of Then condition. See Conditions Supported by the Rule Builder.
- For Source Type, select an option for evaluation by the rule.
The Source Type list displays the appropriate options for the Condition. For example, If conditions can include the following Source Type options: Current Cell Value, Cell Value, Column Value, Row Value, Member Name, Member, Cross-Dim Member, Account Type, Version Type, Var Reporting Type, UDA, Attribute, Generation, Has Children, or Dimension Name. For detailed information about each type of condition, see Conditions Supported by the Rule Builder.
- If applicable for the selected Source Type, enter a value in Source Value by selecting an option or entering a free form value.
- Select an operator for the evaluation: =, !=, <, <=, >, >=, Equals, Not Equals, Contains, Starts With, or Ends With, In, or Not In.
For examples, see Data Validation Conditional Operators.
- Select an option for the appropriate Target Type for the rule.
- Update conditions by clicking an icon in the Actions column to the right of the condition builder:
-
Add Condition
: Add a condition next to the current row.
-
Delete Condition
: Delete a condition at the current row.
-
- Select conditions or condition blocks to update.
To update condition blocks, click an icon in the Condition area, at the top of the condition builder:
-
Add Condition Block
: Add a condition block within the validation rule starting with If. You can expand or collapse the condition. See Conditions Supported by the Rule Builder.
-
Delete Condition Block
: Delete the selected condition block.
-
Cut Conditions
: Delete selected conditions, and copy them to paste in a new location.
-
Copy Conditions
: Copy selected conditions.
-
Paste Conditions
: Paste selected conditions to a new location.
-
Group Conditions
: Group the selection within a condition, and add a grouping parenthesis. In addition to groupings that you set, the If statement in the grouping block is grouped when a condition is grouped, and the Custom Grouping option is enabled.
-
Ungroup Conditions
: Ungroup the selected conditions. The grouping parentheses are removed from the selected condition. One grouping is removed from the condition each time Ungroup is selected.
You can also set your own grouping for conditions by selecting Custom Grouping, then setting up the grouping in the rule definition area.
Selected conditions are displayed as shaded. To clear selected conditions, click once more to the left of the Condition column.
-
-
For Condition, select an option to begin the
condition statement: If, Else
If, Else,
Then, Range,
Check Range, or
Format.
-
Click
(Process Cell) in the rightmost column to add processing instructions.
Note:
If the icon isn't displayed, ensure that the rule is valid and that it permits cell processing instructions. For example, cell processing instructions are included for Else, Range, Then, and Format conditions. The icon isn't displayed until all required columns are selected for a rule.
See Formatting Cells.
-
As a reminder, when you're ready to enable the rule to make it available
in the form, select Enable format/validation rule.
Tip:
While you're building a rule, you can save the rule without enabling it. After any errors are resolved and the rule is ready to be validated and used, you can enable and save the rule to make it available in the form. You can temporarily disable a rule by clearing Enable format/validation rule.
- When you finish updating the rule, validate the rule:
- Click Validate.
The validation status displays at the top of the dialog box. You must correct errors before you save changes. If you close the dialog box without validating rules and fixing errors noted during validation, updates are not saved.
- After fixing any errors noted during validation, ensure that Enable format/validation rule is selected above the rule definition area to enable the rule for the application.
- After the rule is validated, click OK.
- Click Validate.
- Optional: In the Form and Ad Hoc Grid Management page, view and update rules:
-
In the Format/Validation Rules pane on the right side of the Form and Ad Hoc Grid Management page, add, edit, or delete rules at any level, including the grid level, by clicking
(Add Validation Rule),
(Edit Validation Rule), or
(Delete Selected Validation Rule).
-
If multiple rules are defined at the same location, you can change the order in which rules are processed when rules have the same precedence. To move a rule up, down, or to the top or bottom of the list, select the rule and click the arrows. See Order of Evaluation and Execution for Data Validation Rules.
-
Select form validation rules options:
Table 18-1 Form Validation Rules Options
Option Description Validate only for pages with existing blocks When enabled, the system figures out which page combinations have potential blocks and runs the validations only for those page combinations. There are a few exceptions to this. If a page combination has any Dynamic Calc, Dynamic Calc and Store, Label only, or Store with one child member, then that page is always loaded. Validate only for cells and pages the user has access to When enabled, validations are run as the currently logged-in user and not as the Service Administrator, which means the user’s security will be applied to the form members.
-
- In the Form and Ad Hoc Grid Management page, preview and validate the form, resolve any validation errors, and then save changes.
For forms that have data validation rules enabled, rules are validated when the form is loaded or saved. Data validation rules are saved when the form is saved.
See Creating Forms.
When users open the form, they can view and resolve validation messages using the Format/Validation Messages pane.
See Resolving Data Validation Errors in Working with FreeForm.