Applies to version: 2021.1.x and above; author: Dawid Golonka
From version 2021.1.4.36, new built-in functions have been introduced to WEBCON BPS. These functions are used to set the requiredness of fields on the form. They allow you to configure the form in terms of dynamic setting required fields to be completed.
The ability to set the required form fields (or item list columns) on the form depending on the value change of other form fields is one of the most frequently used system functions. Until now, to achieve this effect, it was necessary to change several configuration places of the system. To describe the operation of the new functions, a workflow was created to approve purchase requests.
Fig. 1. Workflow diagram
Below there is an example form with the configured functions:
Fig. 2. The prepared form
The form contains a list of basic fields to be filled out – information about the purchaser, purchase details, and a list of products. The total order amount is automatically moved from the item list to the “Total amount” form field on the form.
In a situation where the total amount of the order exceeds the limit set for a given employee, the “Justification of order” field will become required. Secondly, if in the “Equipment list” item list, the IT equipment category is selected – the user should attach a file with the department head’s consent.
The filled out form:
Fig. 3. The filled-out form
For the last two positions from the list, it was required to add the department head's consent (red dot in the column) - both of these positions relate to the "IT equipment" ategory. The total order amount has exceeded the limit for the register - therefore it has become required to complete the "Justification of need" field.
For the function MARK REQUIRED I MARK NOT REQUIRED to work properly, the field and item list columns in which requiredness will be modified should be set as ‘required’ in the field matrix.
Fig. 4. Field matrix - setting the "Justification of need" form field
Fig. 5. Field matrix - setting the "Department Head's Consent" form field
The total order amount from the item list is transferred to the “Total order amount” form field. The value changes in the field, so the rule controlling the requiredness will be triggered – the rule contains new functions.
When the order amount limit for an employee is exceeded, the Justification of order field becomes required (MARK REQUIRED) otherwise this field is not required (MARK NOT REQUIRED). The configuration of the function is simple, the only parameter that should be given is the form field requiredness you want to change. As the following rule also applies to the field with the limit, it will be executed on changing the value of this field as well.
Fig. 6. The form rule containing new functions - form field
Important! The “MARK NOT REQUIRED” function works only on the form fields previously set as required by the “MARK REQUIRED” function. It does not work on form fields set as required using the field matrix and business rules executed in the “Editability and requiredness” tab.
The situation is similar when setting the requiredness on the item list columns. When selecting the "IT equipment" category, a user must attach a file with the department head's consent. The form rule responsible for requiredness is executed on value change in the "Category" column.
Fig. 7. The form rules containing new functions - item list
The configuration of the "MARK REQUIRED" and "MARK NOT REQUIRED" functions in the case of item list is limited to indicate the list and the column, the required condition of which is to be set. Similarly to the work on form fields, here also the “MARK NOT REQUIRED” function works only on the columns previously set as required by the “MARK REQUIRED” function.
When one of the functions is used in the form rules triggered on a value change (this business case) or inside the FOR EACH ROW function, its operation will only apply to the current row (see Fig. 3).
The configuration of the "MARK REQUIRED" and "MARK NOT REQUIRED" functions in the case of item list is limited to indicate the list and the column, the required condition of which is to be set. Similarly to the work on form fields, here also the "MARK NOT REQUIRED" function works only the columns previously set as required by the "MARK REQUIRED" function.
The most important difference is the way of setting the field matrix. The fields and columns on the matrix, the requiredness of which will be changed, have been set by default as required.
Fig. 8. Field matrix - setting the "Justification of need" form field
Fig. 9. Field matrix - setting the "Department Head's consent" form field
The next step is to set the rule limiting the requiredness of the "Justification of need" form field in the "Editability and requiredness" tab.The rule below returns TRUE when the total order amount exceeds the limit order amount.
Fig. 10. Configuration of requiredness restriction rule
Then, in the field in which a user must provide a reason – select the “Value change will cause default values to be refreshed” option on the General tab.
Fig. 11. General configuration of the "Order amount limit" form field - the "Value change will cause default values to be refreshed" option
Fig. 12. General configuration of the "Total order amount" form field - the "Value change will cause default values to be refreshed" option
Let’s go to the item list settings. In the “Department head’s approval” column, add a rule in the ‘Requiredness restrictions’ tab. The row in the column will only be required if the category is “IT equipment”.
Fig. 13. Configuration of the requiredness restriction rule
After entering value to the form, you can see that its behavior is identical - the consent fields in the case of the "IT equipment" category, as well as the reason field have become required.
Fig. 14. The prepared form (using the previous "old" method)