Syntax for Fields from Joined Records and Searches
You can modify advanced templates in the template editor to include fields from records directly joined to the current transaction.
-
Syntax is
${record.related_record.fieldId} -
To include sales description field values from related item records in a sales order template, use the syntax:
${record.item.salesdescription}
You also can include search results fields from searches joined directly to the current transaction.
-
You can use the index number to indicate the search result row to be referenced to obtain a field value. For example,
[0]would indicate that the field value from the first row returned in search results should be used. -
Syntax is
${results[search_result_line].related_record.fieldId}.For example, to include the first customer phone number from a sales order search, type:
${results[0].customer.phone} -
To include a list of search results, use a list directive as shown in the following example.
<#list results as salesOrder> <p>${salesOrder.customer.phone}</p> </#list>