Rules Conditions and Actions Guide [Information]

Modified on Mon, 14 Apr at 10:08 AM

Order rules workflow features allow you to set automatic actions whenever a Sales or Purchase Order matches specific conditions. These conditions and actions are covered in detail in this article.


NOTE: To use the conditions and actions detailed in this article, you need to add them to an existing order rule. For more information, refer to: How to Create Sales/Purchase Order Rules [Step-by-step guide] and How to Edit Sales/Purchase Order Rules [Step-by-step guide].



CONDITIONS



Conditions will have one of two results once evaluated: True or False.


NOTE: Conditions are stateless by design: they don't maintain context across multiple logical operations. This means each condition is evaluated independently, without preserving information between evaluations. Keep this in mind when combining conditions using logical operators.


For example, if you have a condition that checks if the Sales Channel is Shopify (defined as Sales Channel > Equal > Shopify), as orders come into techOMS, the rule will detect if that is True or False. 



If the result is True, techOMS will execute the following action. If False, it will ignore it.


More conditions and operators can be added. For example, if the order comes from Shopify AND is International (Canada is considered Domestic in this case), you could expand the rule by adding a condition (using the Plus icon) and defining it: 


 

You will then find three logical operators:

  • NOT: Results in True when the condition is NOT met.
  • AND: Results in True when BOTH conditions are met.
  • OR: Results in True when AT LEAST ONE of the conditions is met.


Parameters and operators


When setting up a Condition, these consist of three parts:

  • A Parameter (e.g. Stock)
  • An Operator (e.g. Less than)
  • A Value (e.g. 100)


A condition set up with these three elements will result in True or False, leading to the action determined by that result.


The available Parameters are:


NOTE: The following parameters apply to all Sales Order Rules (except stated otherwise). Those marked with an asterisk (*) are also applicable to Purchase Order Rules on supported Fulfillment Channels. For more information on supported Fulfillment Channel features, refer to: techOMS Fulfillment Channels - Master List [Guides List].


  • Order
    • Order number*: Order number as mapped from the Vendor System.
    • Reference number*: Reference number as mapped from the Vendor System.
    • Source 
    • Ship To Address: Destination Address fields.
      • Country
      • State
      • City
      • Postal Code
      • Address Line 1
      • Address Line 2
      • Address Line 3
      • Contact Name
      • Contact Company
    • Bill To Address: Billing Address fields.
      • Country
      • State
      • City
      • Postal Code
      • Address Line 1
      • Address Line 2
      • Address Line 3
      • Contact Name
      • Contact Company
    • Total: Total value of the order.
    • Fraud Score: As converted for the available Sales Channels.
    • Sales Channel: Origin Sales Channel.
    • Warehouse*: Preassigned Warehouse if any.
    • Carrier
    • Shipment type: Order's Shipment type (Small Parcel or LTL) at the order level.
    • Service
    • Notes: Order notes value.
    • Reference Code
    • Reference Value
    • References*: This option is available to purchase order rules only.
    • Tag value (when supported)
    • Line
      • Number
      • SKU Code
      • Quantity
      • Reference Code and Value
    • Product Variant References
      • Reference Code and Value
    • Target Variables
      • Status
      • Warehouse
      • Carrier
      • Shipment Type: Determine if it is Small Parcel or LTL.
      • Service
      • Expected Delivery Days
      • Expected Delivery Cost
      • Expected Delivery Is Weekend: True or false, to determine if it is a weekend shipment or not.
      • Expected Delivery Day of the Week
  • Functions
    • Is Enough Stock: Checks either True or False based on the stock level.

      WARNING: As outlined above, functions are stateless, therefore:
      • This function should not be used multiple times with the same warehouse within a single rule.
      • When used with logical operators within a single condition, this function may be re-evaluated independently, potentially resulting in misleading outcomes. 

      To ensure reliable outcomes, use it only once per warehouse and, if you need to check multiple warehouses, nest it to use it only once per evaluation. If your goal is to generate a list of eligible warehouses based on stock availability, use the Calculate Enough Stock Action instead, as described in the Actions section below.

    • Ship to Postal Code: Converts postal code string to number if possible, allowing you to set conditions on ranges (e.g. under than 20000).
    • Has Missed Product Variant(s): Checks if the order contains lines with missing product variant(s).


Once you select a parameter, you will need an operator. Depending on the parameter type, you will have different operators available:


OPERATOR
DEFINITION
FOR TEXT
FOR NUMBER
EqualVerifies if the parameter is equal to the value.
Not EqualVerifies if the parameter is different to the value.
Starts WithVerifies if the parameter starts with the entered value.
Ends WithVerifies if the parameter ends with the entered value.
ContainsVerifies if the parameter contains with the entered value at any point of it.
InAllows verifying if a value matches with more than one value at a time for a parameter with comma separated values (e.g. CA, US, GB, MX).
Not InAllows verifying if a value is not within one of the values you can enter at a time for a parameter with comma separated values (e.g. CA, US, GB, MX).
Is NullVerifies if the parameter is null.
Is Not NullVerifies if the parameter is not null, regardless of the value.
Greater thanVerifies if the parameter is greater than the entered value.
Greater Than or EqualVerifies if the parameter is greater or equal than the entered value.
Less ThanVerifies if the parameter is less than the entered value.
Less Than or EqualVerifies if the parameter is less or equal than the entered value. 




ACTIONS



Below you can find all the available order rules actions.


NOTE: The following actions apply to all Sales Order Rules. Those marked with an asterisk (*) are also applicable to Purchase Order Rules on supported Fulfillment Channels. For more information on supported Fulfillment Channel features, refer to: techOMS Fulfillment Channels - Master List [Guides List].


Set Status Action*


Modifies the order status.


 

Send to Warehouse Action*


Sends the order to a specific warehouse.


 

Send Notification Action*


Sends notification messages to a specific user and email accounts. You can also insert value variables (Order numbers, warehouse, etc).


 

Add Line(s) Action


Adds lines to an order, indicating the product(s) and quantity.


 

Remove SKU(s) Action


Removes SKUs matching the codes detailed; you can also choose to remove all unmatched product variant lines if the box is checked.


 

Calculate Enough Stock Action


Creates a prioritized list of warehouses based on stock availability for the whole order. If combined with the Select Warehouse Action, this action should be executed first.


 

Calculate Time & Transit Action


Creates a list of warehouses based on techSHIP's provided transit time for the whole order. If combined with the Select Warehouse Action, this action should be executed first.


 

Select Warehouse Action


Selects a warehouse from a previously calculated list (generated by actions like Calculate Enough Stock Action or Calculate Time & Transit Action) after applying the filter below.


Optional filters:

  • Only Enough Stock: Considers only warehouses with sufficient stock.
  • Ignore Time in Estimated Delivery Date: When checked, considers only the delivery date, disregarding the estimated delivery time. Otherwise, it considers both. This information is provided by techSHIP.


Selection criteria:

  • Warehouse Priority: Selects the warehouse with the highest priority (1 being the highest).
  • Shortest Transit Time: Selects the carrier/service with the shortest delivery time provided by techSHIP. If multiple carriers have the same delivery time, the cheapest is selected.
  • Lowest Shipping Cost: Selects the carrier/service with the lowest shipping cost provided by techSHIP.


NOTE: No time zone conversion is required; the date and time are already in the local (destination) time.


 

Set Carrier and Service Action


Forces a Carrier and Service level to the order; you can also check "Use Target Variables" if you will have a Select Warehouse action that will populate CarrierID and ServiceID beforehand.



Set Carrier Account Action 


Forces a Carrier Account to the order, specifying payment terms, number, postal code and account country.



Add Order Reference Action*


Adds new Order References, and new Order Line References as required; it is necessary to define the Reference Type (value, variable, property), its code and the value based on the Type.


NOTE: If you have consecutive Add Order Reference Actions in the workflow with the same Reference Code, these will concatenate their values; e.g., (if Action 1 and 2 have values A and B, respectively, and their Reference code is both X, then the Reference Value will be A B).



Add Product Variant Substitution action


Replaces a product variant with another.



Raise Exception Action


Raises a custom exception, specifying its description, message title, and details. The exception will be logged in the Sales Channel Log and displayed in the Statistics & Exceptions Dashboard.




Split Shipment Action


Splits the entire order into multiple shipments, at the SKU level, so it can be fulfilled by more than one location: 

  • Maximum Number Of Shipments: Sets the maximum number of shipments the order can be split into.
  • Prioritize Shipments Based On: Defines the criteria used to split the order across locations:
    • Count Of Item: Splits the order based on the total number of items. Warehouses are sorted by their ability to fulfill the largest share of items.

      NOTE: For example, if an order contains 10 units (5 of SKU A and 5 of SKU B) and:
      • Warehouse 1 can fulfill 6 units
      • Warehouse 2 can fulfill 4 units

      Then, the action will assign 6 units to warehouse 1 and 4 units to warehouse 2.


    • Total Order Value: Splits the order based on the monetary value of the items. Warehouses are sorted by their ability to fulfill the highest portion of the order's subtotal value.

      NOTE: For example, if an order contains:
      • 3 units of SKU A ($ 50 each)
      • 2 units of SKU B ($ 100 each)
      • 5 units of SKU C ($ 10 each)

      Then, the total value is $ 400. If:

      • Warehouse 1 can fulfill 3 units of SKU A and 2 units of SKU B (totaling $350).
      • Warehouse 2 can fulfill 5 units of SKU C and 2 units of SKU B (totaling $250).

      Then, the action will prioritize Warehouse 1 to fulfill the highest-value portion ($350), and assign the remaining items to Warehouse 2.


WARNING: This action must be used in conjunction with other conditions. Refer to: How to Split Shipments Automatically [Guide] for detailed workflow examples on combining these actions for optimal results.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article