Checking the executions of triggers and validation If you need to check a trigger or validation for correct functioning, you can use the actions log, which displays each execution and, if it occurs, an error with a detailed description. false W3sidGl0bGUiOiJBdXRvbWF0aW9uIiwidXJsIjoiL2RldmVsb3BlcnMvYXV0b21hdGlvbi8ifSx7InRpdGxlIjoiUGlwZUxhbmciLCJ1cmwiOiIvZGV2ZWxvcGVycy9hdXRvbWF0aW9uL3BpcGUtbGFuZy8ifSx7InRpdGxlIjoiUHJlcGFyYXRpb24gcnVsZXMiLCJ1cmwiOiIvZGV2ZWxvcGVycy9hdXRvbWF0aW9uL3BpcGUtbGFuZy9wcmVwYXJhdGlvbi1ydWxlcy8ifV0= Automation /developers/automation/ ["developers","Automation"] ["developers","Automation","PipeLang"] developers

Checking the executions of triggers and validation

If you need to check a trigger or validation for correct functioning, you can use the actions log, which displays each execution and, if it occurs, an error with a detailed description.

After creating a trigger, you often need to set it up to get the necessary logic that was originally conceived. You can check whether the trigger has been executed, whether a message from validation has appeared for some wrong action in the system, in the “Actions log”.

Let’s filter by the “Record type” field with the “Triggers” value, in the “Message” field, specify the symbolic code of the trigger that you want to check for execution.

In the result that appears, we see an active link with the symbolic code of the trigger, which leads directly to the trigger setting, the second link contains the order ID, which is located in the address bar of the order card browser, the symbolic code of the field that changed in the order and resulted in the trigger execution, is specified in the brackets of the “changeset” parameter, the “expression” parameter will contain the code of the trigger action that it performed in the order.

Let’s consider an example of a record:

Action "order_change.modify.order" [eid=2549] started for rule[code=start-email] with context order[id=411], changeset(last_name), expression ('No last name')

code = start-email - the symbolic code of the start-email trigger. [id = 411] - order ID - 411. changeset (last_name) - the field last_name (last name) was changed expression ('No last name') - the text was written in the field changed by the trigger: No last name.

If you specify the order ID from RetailCRM in the message field separated by a space after the symbolic code of the trigger, the log will filter all trigger executions on a specific order. If we delete the symbolic code of the trigger and leave only the order identifier, we will see the execution of any trigger on a specific order.

To track the validation execution in the order, you must change the value of the “Record type” filter to “Validation”, in the “Message” field you can specify the exact text of the validation message, which is specified in its settings, as a result of which you receive a list of validation executions with the order ID. Also, you can specify the order identifier in the “Message” field, resulting in a list of validations that were executed for a particular order.

For example the entry:

Order validation (413): You are not allowed to change the order status!

It will mean that the validation was executed for the order with the ID specified in brackets, that is, 413 and showed the message:You are not allowed to change the order status!.

Thank you for your feedback.
Was this article helpful?
No
  • The recommendations did not help
  • There is no answer to my question
  • The text is difficult to understand
  • I do not like the described functionality
Yes
Previous article
Points to note when forming a validation
Validation is designed to create additional checks for changes in fields that the user makes in the system.
Next article
Working with http requests in triggers
When working within the system, you may need to send information to external services from the order or customer fields. This can be done using a trigger with an http request.