Any solution for this Error?

var xmlTemplateFile = file.load(‘Templates/PDF Templates/template.xml’);
var renderer = render.create();
renderer.templateContent = xmlTemplateFile.getContents();

var recI = record.load({
type: ‘customrecord_emp_data_pr_process’,
id: 1609
var paySlip = renderer.addRecord({
templateName: ‘record’,
record: recI

var paySlipPdf = renderer.renderAsPdf();


Any solution for this Error?

Rookie Asked on January 31, 2021 in SuiteScript.
Add Comment
2 Answer(s)

Depends on the template, and the data you are working with, but the answer is that the xml you are generating contains predefined entities that must be replaced.

You may want to do the replacement in code, but freemarker has 2 ways to do the replacement for you:  output format and escape.

Advanced Answered on January 31, 2021.
Add Comment

<#if companyInformation.logoUrl?length != 0>

Error part is   ?length != 0

if I am not including this part of code works perfectbut company logo not shown. I read your article but can’t understand or solution not find.


Rookie Answered on January 31, 2021.

companyInformation.logoUrl is a url that probably contains an &, which must be escaped. Use one of the freemarker escape mechanisms to do so

on January 31, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor