Syntax for Body Fields
For most template body fields, the syntax is ${object.fieldId}, for example, ${record.entity}.
-
Currently, you can use the following objects:
-
companyInformation– company information for the current NetSuite accountFor example,
${companyInformation.companyname}is the name associated with the NetSuite account.Enter
${subsidiary.mainaddress_text}to include the subsidiary address on a template. -
record– current transaction recordFor example
${record.trandate}is the date of the transaction. -
records– reference multiple data sources, which you typically need to do in label, check and statements templates, for example,${statement.amountDue}. -
customer– only available on Statement records, this includes customer-related information about the template. For example, you could include${customer.subsidiary},${customer.subsidiary.legalname}, or${customer.entityId}. -
salesorder– available on packing slips -
preferences– include settings entered on the Setup > Company > Printing & Fax page. -
user– include settings entered on the user’s Set Preferences page. These fields are typically used for emails.
-
-
You can include fields that dynamically return a URL link to NetSuite pages, or to parts of a URL, such as the account ID:
Note:In the following examples, replace the variable <accountID> with your account ID.
-
${companyInformation.companyId}— Your NetSuite account ID. -
${companyInformation.appDomain}— Application domain, for example, <accountID>.app.netsuite.com. -
${companyInformation.customerCenterDomain}— Customer center domain, for example, <accountID>.app.netsuite.com. -
${companyInformation.customerLoginUrl}— Customer login URL, for example, https://<accountID>.app.netsuite.com/app/login/secure/privatelogin.nl?<accountID> -
${companyInformation.extformsDomain}— External forms domain, for example, <accountID>.extforms.netsuite.com.
Note:To find your account ID, go to Setup > Company > Company Information. The Account ID field is at the bottom of the right column. To view the correct format for all your account-specific domains, click the Company URLs subtab.
To view Account ID and Company URLs, you must have the Administrator role or the Setup Company permission.
-
-
You can include fields from records related to the current transaction record if they're of type select (not sublists).
Syntax is
${record.related_record.fieldId}For example, to include customer field values from related item records in a sales order template, use the syntax:
${record.entity.email}. You can also refer to custom fields, for example, include a transaction column field on a purchase order template by entering${record.expense.custcol_cc_oversize}. -
The syntax for body fields can include an additional component, such as the following:
-
${object.fieldId@label}- indicates the label of a field should be printed.For example,
${record.entity@label}: ${record.entity}indicates the label for the entity should be printed with the entity, that is, Customer: City Art Gallery. The label is the text that appears next to the field on the transaction form. -
${record@title}- indicates that the name of the transaction record type should be printed, for example, Sales Order for sales order.This can be used for record objects only. For other objects it'll return a blank string.
-
-
Fields that include a link, such as images or URLs, are enclosed in an HTML element, for example,
<img>or<a>. You have two options for link fields:-
Use the field to include the HTML markup source. For example,
${record.hyperlink}returns the following:<a href src="http://www.netsuite.com">http://www.netsuite.com</a> -
Add
@urlto the field to return the link without the HTML. For example,${record.hyperlink@url}returns the following:http://www.netsuite.com
-
Related Topics
- Syntax for Advanced Template Fields
- Entering a Field Manually to an Advanced Template
- Syntax for Sublist Fields
- Syntax for Address Subrecords
- Syntax for Fields from Joined Records and Searches
- FreeMarker Formatting Method
- Updating a Statement Template to Support Multiple Currencies
- File Cabinet FreeMarker Directive