How To: Inherit Rules Between Views and Forms
View rules can be set up to execute independently from Form rules , but they can also be used to add on to in a Form. If a View rule is created in the View designer, this rule is available for editing in the Form designer's rules section. When the View rule is changed on the Form, it does not modify the rule on the View. However, if the rule is changed in the View designer for the rule that was previously overwritten in the Form, the change to the View rule will apply to the rule on the Form. The Form rule therefore inherits the View rule and will see the changes made, but will still apply the previous change made to the View rule on the Form as well.
A rule definition that was created in the View designer can be enabled or disabled in the Form, but not be removed from the rule. Only rule definitions that belong to the specific designer can be removed in that designer.
The following example will help explain the inheritance between View rules and Form rules.
We've created an Item View containing a View rule with rule definition as displayed below:
We then created a Form using the Item View (Sales Form). When selecting the View and clicking on the rules tab in the rules menu on the right, the View rules are displayed as configured in the View designer. Select the rule as configured in the previous step and click Edit.
The View rule opens in the rules wizard of the Form designer.
1 - Note that the rule definition that was added in the View designer, can only be enabled or disabled. It cannot be removed.
2 - Add a rule definition to hide a View control as shown below:
Now open the View in the View designer. Note that the rule definition that was added in the rules wizard of the Form designer as per the previous step is not reflected in the rules wizard of the View designer. The View rule is therefore inherited when opening the rule in the Form designer, but when changing the rule in the Form designer, backwards inheritance is not applied.
We now want to see what will happen if we subsequently change the rule in the View for the rule that we've overwritten in the Form. Add another rule definition as shown below:
Now open the rule in the Form designer. Note that the rule definition that was added in the Form designer to the View rule, is still reflected and in addition, the new rule definition added is also reflected. Changes made to the View rule in the Form designer is not applied in the View, but changes made in the View is inherited by the View rules in the Form designer.
It is important to save and check in a View or Form to affect any changes made