ANS-0407 · PRINTING, PDF & EMAIL TEMPLATES

How to Resolve ‘Expression is Undefined’ in NetSuite Advanced PDF/HTML Templates?

Learn why custom fields may cause 'Expression is undefined' errors when added to NetSuite PDF/HTML templates and how to address them.

Short answer

Adding a custom field to an Advanced PDF/HTML Template can result in an 'Error Parsing XML: Expression is undefined' message. This occurs when the template fails to recognize the custom field reference, such as record.custbody_scanline, preventing the template from being saved. Currently, no direct alternate solution is available within the template editor.

Scenario

Users attempting to add a custom field to an Advanced PDF/HTML Template encounter an error during the saving process. The system displays a message indicating an 'Error Parsing XML: Expression [custom field ID] is undefined', preventing the template from being saved successfully. This issue arises when the template's parser cannot recognize the specified custom field.

Solution

When attempting to add a custom field to an Advanced PDF/HTML Template, the system generates an 'Error Parsing XML' message upon saving. For example, adding a field like custbody_scanline may result in the following error:

Error Parsing XML: Expression record.custbody_scanline is undefined on line 145, column 65 in template.

This issue prevents the template from being saved successfully. This behavior has been identified and logged as a defect (Defect # 244459) within NetSuite. Currently, there is no alternate solution available to directly resolve this problem within the template editor.

Expert NetSuite Support

Need help with this NetSuite issue?

Printing, PDF & Email Templates consulting and configuration support

Talk to a consultant