Check Sum rule
This rule is used to check the sum of values of several fields. The sum of values of specific fields is compared against a preset number or the value in a different field. For example, if your document contains fields with a salary amount, bonus amount, other compensation payments, and a sum total field, you can configure a rule that will check whether the sum of field values matches the sum total in the resulting field. An error message will be displayed in case of a mismatch.
Note: When applying this rule to a field of a Table type, the calculation depends on the level at which the rule was created. If you need to compare the sum of values of all cells of a table column with a calculated or given number, the rule must be created in the Document Definition Properties or in the document section properties. If you need to compare each cell of a column or the sum of all cells of a few table columns with a calculated or given number, the rule must be created in the table properties or in the table column properties.
These direction should also be followed when creating a rule that checks the sum of values for fields with a few instances.
To create a sum check rule, proceed as follows:
- Open the field properties dialog box (right-click the field to open its shortcut menu and select Properties...) or the Document Definition properties dialog box (from the Document Definition editor menu, select Document Definition → Document Definition Properties...).
- Go to the Rules tab.
- Click the New Rule... button.
- From the list of rule types, select Check Sum and click OK.
- Type the name of the rule.
- Disable the Show rule name in message to verifier option if necessary. If this option is disabled, the error message will be displayed as "error message" instead of "name of rule: error message".
- Specify the severity of the rule.
- If required, specify the conditions under which the rule must be applied (by default, a rule is applied unconditionally). See Conditions for applying rules for more information.
- Specify tags for the rule.
- Disable the Enabled rule option if necessary. The rule will be created, but will not be applied until this option is enabled by a user.
- Click Next >.
- In the dialog box that opens, add to the list Summarize values of fields the fields the sum of whose values you want to check. Use the Add... button to add fields.
- Enable one of the options:
- field to compare the sum with the value of the resulting field. Select the name of this field using the Select... button.
- number to compare the sum with the specified number. Enter this number.
- Precision is the maximum permitted difference between the values of fields for which the rule is set up. A rule is considered to be satisfied when the absolute value of the difference between the values is less than or equal to the specified precision value. If it is not, the rule is not considered to be satisfied and an error message is generated..
- Enable the option At least two non-empty objects required if you want at least two non-empty and non-zero summands to be used. If this condition is not met, the rule will return an error.
- Confirm fields if rule check is successful If this option is enabled, the field values that pass rule validation will be automatically confirmed in the Document Definition editor. Otherwise, the Verification Operator will have to confirm field values manually.
- Click Finish to complete creating the rule. The name of the rule will be shown on the Rules tab.
4/12/2024 6:16:02 PM