Adding and Removing Fields in Advanced Templates

You can see the fields available to include on an advanced template by reviewing the template in the template editor. You can add and remove fields as needed, and also add currency symbols in front of fields, by following the steps in the following procedures:

Note:

Sublists displayed in the field selector are dimmed and appear for reference only. You can't add sublists to a template from the field selector. Instead, you must edit the markup source to add a sublist. In addition, you can reference fields on a sublist only at the first level. Referencing sublists at the second level isn't supported, with the exception of addresses. For more information about adding sublists to a template, see Source Code Editing in the Template Editor.

Adding a Field to an Advanced Template

You use the Fields selector to add a field to an advanced template.

To add a field to an advanced template:

  1. Go to Customization > Forms > Advanced PDF/HTML Templates and click Customize or Edit for the advanced template.

  2. Place the cursor where you want to add a field in the template editor.

  3. On the New Element toolbar, click the Fields button to open a selector that lists all fields you can add to your template.

    Advanced PDF/HTML Template Fields list The list of available fields
    • The Fields selector lists all printable fields and sublists you can add, based on the features enabled in your account. For a complete list of fields and sublists, see Advanced Templates Reference.

    • Subrecords aren't supported, with the exception of address records.

    • Fields and sublists are listed alphabetically and grouped by record name, with data type and ID shown. Each record can be collapsed or expanded to show the available fields. To add a sublist to a template, you must edit the markup source. In addition, with the exception of address records, you can reference fields on a sublist only at the first level. Referencing sublists at the second level isn't supported. For more information about adding sublists to a template, see Source Code Editing in the Template Editor

    • You can use the selector's search to quickly find the field you need. Enter part of the field label in the selector’s Search field to narrow the list of displayed fields.

  4. If you want the field label to be displayed in the template along with the field value, check Include Label in the Fields selector.

  5. To add multiple fields, use the mouse to separate the fields.

  6. When you've finished adding fields, click the Close button.

    The fields are shown on the template. If you point to the label, the FreeMarker identifier for the field appears:

    Advanced PDF/HTML field hover example
Important:

You can also enter FreeMarker syntax to add a field or label to the template instead of using the selector. With the exception of address subrecords (as of 2019.2), the selector doesn't include subrecord fields. You must use FreeMarker syntax to add non—address subrecord fields. For information about this syntax, see Syntax for Advanced Template Fields.

If you have the appropriate permissions, you can use FreeMarker syntax to include address subrecord fields and reference fields or labels in advanced templates.

Adding Address Subrecord Fields to Advanced Templates

Advanced PDF/HTML Templates directly support the address subrecord. For the address subrecord, you can:

  • Use the field selector to directly select subrecord address fields, like City and Street, when you customize advanced PDF printing templates.

  • Select any custom fields created on the address.

  • Use text formatting (font, font size, color) to control the layout and appearance of the address in printed content.

  • Base template logic on address fields — for example, you can use template logic to determine output based on city, state, or zip code.

  • Use available address fields to translate addresses and print the translated labels of individual address fields.

Address fields available in UI:

Advanced PDF/HTML Templates Fields list with shipping address fields outlined in red.

Adding a Currency Symbol to an Advanced Template Field

You can use a FreeMarker expression to add a currency symbol on an advanced template.

To add a currency symbol to an advanced template:

  1. In the template editor, place the cursor in front of the field that represents a currency amount.

  2. Enter ${record.currencysymbol} before the field label shown on the template:

    Sample code for adding a currency symbol.

Removing a Currency Symbol from an Advanced Template Field

You can use the a FreeMarker expression to remove a currency symbol from an advanced template, such as a check.

Use the remove currency format: ${nsformat_number(number|string)}. For more information, see FreeMarker Formatting Method.

Removing a Field from an Advanced Template

There can be some fields on a template that aren't required by your organization.

To remove a field from an advanced template, select the field and press Delete.

For example, if you don't want sales orders to include the company name and address, you could delete ${companyInformation.companyname} and ${companyInformation.addressText}. Note that this example also removes the company logo.

Related Topics

General Notices