Configure validity rule
Feature available starting from version 3.2 of the system.
Prerequisite
- Access to the Configuration > Document > Rule (DC055) menu.
Overview
The validity rule automates the definition of document validity in SoftExpert Document.
In practice, the user simply fills in an attribute in the document that meets the rule condition, and the system automatically identifies and applies the corresponding validity.
The rule does not define the validity period itself. It indicates which validity configuration, from the Administration > Configuration > Validity (AD086) menu, will be used when the document meets its conditions.
This way, the same category can apply different validity periods according to the characteristics of each document, without the need to create several similar categories.
Add a new validity rule
1. Access the Configuration > Document > Rule (DC055) menu.
2. Click + Create and, in the Type field, select the Validity rule option.
3. Enter an ID and a name for the set of validity rules.
4. Click the save button
to enable the Rules tab.
5. On the Rules tab, which gathers the rules that make up the set, click the
button.
6. Fill in the fields of the following steps of the creation wizard:
Identification
Enter an ID for the rule in the available field. Click Next after finishing this step.
Condition
In this step, configure the conditions for the validity rule to be applied. The following sections are available for this purpose:
Category
Apply rule only to the category: defines the category to which the rule applies. If the option is not checked, the rule will be applied to any category the set is associated with. If it is checked, select the desired category in the enabled Category field. For the rule to be effectively applied, the set must be associated in the Control > Validity section of the category.
Attributes
Click the New condition button and select the attribute, an operator, and the value the attribute must contain to condition the application of the validity rule.
- For the rule to be applied correctly, the attribute must also be associated with the category where it is applied.
- The available operators are equals (the attribute must be equal to the informed value) and "contains" (used for attributes that accept multiple values).
- To use more than one attribute as a condition, click the New condition button again and repeat the procedure.
- The Category and Attributes sections complement each other to form the application condition. For example: the rule will be applied only to the "PO - Purchase Orders" category when the value of the "Document type" attribute is "Contract".
Click Next after finishing this step.
Validity
In this step, define which validity configuration will be applied to the documents that meet the rule conditions.
In the Validity configuration field, select the desired configuration. This configuration is the same one used in the Administration > Configuration > Validity (AD086) menu, and it is where the validity period itself is defined.
If you need to create a new configuration or edit an existing one, use the buttons available next to the field.
Click the Finish button to complete the rule configuration.
7. Click the
button to finish.
Associate the validity rule with the category
1. Access the Configuration > Document > Category (DC043) menu.
2. Select the desired category and open its data for editing.
3. In the Control > Validity section, enable validity control.
4. In the Validity configuration field, select the default configuration, which will be used when the document does not meet any rule condition.
5. In the Rule field, select the set of validity rules created previously. Only sets of the validity type are displayed in this field.
6. Save the category.
Apply the validity rule to documents
1. In the Document (DC010) menu, open the data screen of a document in the category that has the validity rule associated.
2. Fill in the attribute defined as the rule condition with the corresponding value.
3. When the rule conditions are met, the system automatically applies the validity indicated by the rule configuration. The "Validity definition" field is then displayed as "By rule", and the validity data is filled in automatically.
4. Save the document.
Impact on documents already created: with the validity rule, any change to the validity configuration used by the rule, to the rule itself, or the replacement of the rule associated with the category also starts to affect the documents already created whose validity is defined by rule. This is one of the benefits compared to applying validity without a rule: when validity is defined directly in the category (without a rule), the changes apply only to new documents and do not affect existing ones. With a rule, every change to the validity or to the rule is reflected in the documents already created that use it.
When more than one condition applies: if the same document meets the conditions of more than one rule at the same time, the system will always apply the lowest validity value, that is, the one that results in the shortest period. This way, the most restrictive configuration always prevails.
- If the attribute is filled in with a value that has no associated rule, or if no condition is met, the document keeps the default validity defined directly in the category.
- While a rule is applied, it is not possible to edit any validity field in the document, even if the applied configuration is a variable validity. The values always follow what is defined in the validity configuration.
- The validity rule does not overwrite the validity of documents that already have a current or approved revalidation, nor the validity of contracts with amendments when the parameter to update the contract validity with the amendment validity is enabled.
- A rule used by a category cannot be deleted while the association exists, and a validity configuration used by a rule cannot be deleted while it is in use.
- The validity rule will only be applied to documents of categories that have validity control enabled and that have the rule selected in the Control > Validity section.
Conclusion
After configuration, the set of validity rules must be associated with the document category, in the Control > Validity section, so that it is applied automatically.
From then on, the documents that meet the conditions have their validity defined by rule, with the advantage that changes to the validity configuration or to the rule are also reflected in the documents already created.
Remember that, while a rule is applied, the validity fields of the document cannot be edited, as the values follow what is defined in the validity configuration. When more than one condition applies, the lowest validity value always prevails.