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!
.