Validation - checking a card of order/customer/corporate customer/tasks for compliance with the specified conditions. The check is performed at the moment of saving the object.
Note
When performing group actions on orders/customers/corporate customers/tasks, validation is triggered.
Information about the triggered validation is visible in the action log. The log displays the order ID and the text of the validation message.
Adding a new validation
The interface for configuring validation checks is the same for private customers, corporate customers and orders.
Field meanings:
Condition- the condition under which the validation check is triggered. If the condition is met, the changes will not be saved. For details on condition settings, see related article.
Message- a message that is displayed if a validation check is triggered. The maximum length of a notification is 5000 characters. Use Twig templates for the message.
You can specify the validation triggering condition for an order in two ways:
- through a visual designer, using existing blocks;
- through the editor, using the code in the corresponding syntax (PipeLanguage);
For the customer, corporate customer and tasks the validation configuration interface looks the same.
Note
Designer mode is not available when configuring validation for the customer, corporate customer and tasks.
Let's take a closer look at each of the ways to create validation:
Designer mode
Note
The designer will not be available if:
• you switched to the editor and made any changes. If the change was accidental, then quit validation without saving.
• the validation condition is initially written in the editor.When all conditions are deleted in the validation editor, the designer becomes available again.
The designer is used to create validation using preset blocks with conditions.
A new condition is added from the existing list of conditions. Conditions are combined by logical AND / OR operators.
Work with a condition (selecting, replacing and configuration of a condition) is carried out in the pop-in window, which is displayed on the right side of the browser. For each condition and options there are tooltips that are displayed when hovered over.
For convenience, a search field is available that will allow you to find the desired condition. The search is carried out by filtering those conditions whose names contain the sequence of characters entered in the search bar. To see the full set of conditions without a filter, you can reset the entered value by clicking the cross on the right, in the search field.
Depending on the type of condition, the following options are available to configure it:
- Selecting a value from a list with a multi select option.
- Checking by occurrence for a symbol code. Please note that the presence of the entered characters is checked in the symbol code, but not in the object name.
- Checking a feature (its presence/absence)
- Comparing the start and end values when changing a field, including the “Any” option.
Important!
You cannot save a condition for validation if it is not filled in completely.
Deleting an added condition is carried out using a cross, which is located in its right part. Deletion is available only in a chain of conditions, deletion is not available from the list.
If necessary, you can duplicate conditions - in the pop-in window, in the lower right corner, click on the “Duplicate” button, and you will be redirected immediately to editing the duplicate.
"Other field" condition
"Other field" is a condition that can refer to system and user fields of order/customer cards.
After selecting a section (order or customer page) you need to select the field you are interested in.
Important points when working with the “Other field” condition:
- The condition works only with fields from customer/order cards and user fields (the user field must be for an order or a customer).
- The condition works only with fields of the following types: string\text, number, directory, flag (Yes/No).
- Some fields may not be available for selection because they are not supported by the designer (for example, date fields or delivery interval). Unfound fields must be worked with in the conditions editor.
- For order validations, you can check the value of the fields of the order and of the customer (which is associated with the order) and changes to the order fields. For customer validations, you can check the value of the fields of the customer and of the order (the first or last non-canceled order of this customer) and changes to the customer fields. Checking of the field changes is possible only if the section corresponds to the selected event.
- Search by fields is available when you select them.
When filling in a condition, a step-by-step designer is used, which changes the data to fill in depending on the selected field in the previous step.
Editor mode
The editor is used to specify conditions that cannot be set using the visual designer due to their absence or, for example, when using a complex chain of objects and nesting of conditions.
Using the editor, you can make changes to the condition created with the use of the designer.