Certain fields can be included in advanced templates even though they are not listed in the Fields selector. For instance, ${record.entity.email} uses the entity field to link to the Customer record, allowing access to all of the record’s body data.
The steps below explain how to manually add fields to the template.
Obtain the field ID for the field you want to add.
- To make field IDs available, go to Home > Set Preferences and ensure that the Show Internal IDs box is checked on the General subtab, Defaults area.
- Find the field in the NetSuite user interface and click the field label to display the field level help text. The field ID will be displayed in the popup window.
For most template body fields, the syntax is ${object.fieldId}, for example, ${record.entity}.
Company Information, for example,${companyInformation.companyname}Also, enter${subsidiary.mainaddress_text}to include the subsidiary address on a template.Record, for example${record.trandate}is the date of the transaction.Records– reference multiple data sources, for example,${statement.amountDue}.Customer– only available on Statement records, this includes customer-related information on the template. For example,${customer.subsidiary},${customer.subsidiary.legalname}, or${customer.entityId}.
The syntax for sublist (line item) fields is similar to body field syntax. Sublist fields are denoted with syntax like:
${item.item@label}${item.id}${item.item}${item.quantity}
When the sublist ID is the same as the field ID, @list is added to the sublist ID. The correct syntax appears in the Fields selector automatically.
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}
Use of the SuiteScript reference guide in conjunction with the SuiteScript Records Browser is required. You may access all of the record’s fields, sublists, and search filter fields within the Records Browser. In addition, the Records Browser contains the IDs required to access NetSuite records, fields, sublists, search filters, rights, features, and other items in SuiteScript. It also offers field-level support for many of the fields that exist on the record.
Navigate to the SuiteScript Records Browser: https://tstdrv2791108.app.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2023_1/script/index.html