Order variables are used for both for documents customized in application settings and for formatting reports using page templates. Using order variables for documents customized in application settings is documented here.
For page templates, the order variables are available when the following conditions are true:
- Order ID has been selected as a primary column (it does not work if the Order ID is in a calculated column)
-
The Order ID primary column has a value in the first row following a page break that starts a new report section.
The easiest way to check that the order variables will be available in the page template for a report is to export the report to Excel and verify that there is an order id in the first row of each sheet in the output.
Please note: when working with reports for shipments, invoices, quotes, or returns the order variables are not available in the page template unless the Order for XXX: Order ID primary column is added to the report.
Customer and supplier variables
If the order variables are available and the order is a sales order, then the variables for organizations are available for that customer under the key customer. For example, to include the customer's primary address write {{customer.addressFormatted}}.
If the order variables are available and the order is a purchase order, then the variables for organizations are available for that customer under the key supplier. For example, to include the supplier's mobile phone number write {{supplier.telecomMobileNumberFormatted}}.
List of variables
- order.orderId
- The orderId
- order.orderDate
- The order date
- order.customerPo
- For sales, the customer's purchase order number
- order.settlementTermName
- For sales, the terms selected on the sales order
- order.shipFromFormatted
- The ship from address as display on the purchase or sale order
- order.shipToFormatted
- The ship to address as display on the purchase or sale order
- order.billToFormatted
- The bill to address as display on the purchase or sale order
- order.shipFromDirections
- The ship from directions as display on the purchase or sale order
- order.shipToDirections
- The ship to directions as display on the purchase or sale order
- order.billToDirections
- The bill to directions as display on the purchase or sale order
- order.publicNotes
- The notes to supplier or notes to customer on the purchase or sale order
- order.privateNotes
- The private notes on the order
- order.adjustmentListFormatted
- Arrays of objects containing discount, taxes, and fees on the orders. Each object has description, amount, and amountFormatted fields.
- emailHomeFormatted
- The email address for Home purpose
- emailWorkFormatted
- The email address for Work purpose
- emailBillingFormatted
- The email address for Billing purpose
- emailPaymentFormatted
- The email address for Payment purpose
Example of how to format these:
{{#if order.adjustmentListFormatted}} {{#each order.adjustmentListFormatted}}{{description}} {{amountFormatted}}<br />{{/each}} {{/if}}
- order.userFieldData.user_NNN
- These are used to include any custom fields defined on the sale order or purchase order. For example if there are 2 custom fields defined for sales orders named "Sale name" and "Sale date". The following code snippet would merge the fields into the document on two separate lines with a label on each line:
The name of the sale: {{order.userFieldData.user_000}} <br/> Date of the sale: {{order.userFieldData.user_001}}
The exact names of the fields are displayed on the screen in application settings where the fields are defined in the column labeled Template variables.
Comments
0 comments
Article is closed for comments.