Macros

Macros is a small piece of programming code which is triggered when an even happens in the system. This allows you to program some workflow functionality into Linnworks using its own evaluation parser. This document describes how to set up and use macro. We will not discuss in details the macro syntax as this is beyond the scope of this manual, but rather present couple of examples on how to achieve some degree of custom workflow (automation) within the system without invoking any bespoke changes.

Creating/Editing macros

 

Examples

    1) Change the postal service of a new order based on the weight of the order. If order weight is over 5000 grams  (5Kg) then the postage service will automatically switch to DHL Next Day (the name of the postal service as defined in the Postage Management settings screen)

OrderPostage.PostalServiceName := iif[OrderPostage.TotalWeight>5000,"DHL Next Day", OrderPostage.PostalServiceName];


2)Record recalculated Tax field based on 15% inclusive tax from total order value

Order.fTax := Order.fTotalCharge / 115 * 5;