Automatic Rules
It is possible to automatically execute actions at certain events within Stoqflow, such as when creating an order or updating stock.
Via Settings > Rules automatic rules can be created and managed. A rule consists of a trigger, optional filters, and one or more actions, and can be permanently enabled or within a specified time slot (for example, to apply rules only on orders during a temporary commercial promotion).
Overview
Via the overview, it is possible to:
- Adjust the order of rules
- Quickly enable or disable rules
- Edit, duplicate, or delete rules
?> The order of rules in the list indicates in which order the rules are applied. This is important because executing a rule can ensure that an order/product/etc. no longer meets the filters of a subsequent rule.
Fields
Triggers
For every rule, a trigger must be chosen. An event where it is checked whether the rule should be executed. Some important triggers are, for example:
- When an order is created
- When an order is edited
- When new stock is booked
Filters
Filters are optional and can be used to determine whether a rule should or should not be executed. For example, a rule can only be executed when the order must be sent to a specific country or a product belongs to a certain trade name. The order/product/etc. must meet all filters in the rule before the actions are applied.
Actions
Actions are the effective actions that are applied when a rule is executed. Some examples of actions are:
- Making an adjustment, such as adding a delivery note to an order or editing the existing delivery note
- Adding an item, such as adding extra information to an order
- Sending an email to one or more internal users
- Displaying a notification to one or more internal users
Actions can be set up to be executed repeatedly () or only once () on the same order/product/etc., so you can choose, for example, to add a delivery note when an order is created for the first time but leave the delivery note as it is during subsequent edits.
When are rules executed?
Rules are always executed before the trigger of the rule is recorded in the database. This means that when a rule is executed while editing an order, the related actions are applied to the order between the moment you click "Save" and the order is actually saved.
Examples
As you can see, the possibilities of automatic rules are very extensive. Below are some examples of rules we find useful:
- When creating an order to Germany, set the preferred carrier to DHL
- When creating an order with a specific product, add extra information (with highlight) with the message that a folder must be added during packaging.
- ...