Advanced PDF NetSuite Tutorial

Anurag KumarAnurag Kumar
1 min read

You can write the If else statement this way: .locale is used for the translation to different local languages based on user localization preferences.

<#if .locale =='zn'>
   font-family: sans-serif;
<#elseif .locale =="ko">
   font-family:verdana
<#else>
   font-family: sans-serif;
<#if>

BFO functionality can be used to create macros that repeat HTML code on each page. Each macro is defined in the head part of the template inside the <macrolist> tag.

How to Fetch Field Details:

Field: ${record.otherrefnum}

Label: ${expense.customer@label}

Divide two labels: ${record.reimbursable/record.total}

${record.entity.phone}

${subsidiary.logo@url}

Greater than symbol (gt)

<#if total gt 300>

<div> ${total}</td>

<#if>

gt → greater than

lt → less than

gte → greater than or equal to

lte → less than or equal to

Update a string value

${record.memo?string(“Test“, “Rest“)} // Replace Test with Rest

Assign a variable

<#assign total =10>

${total}

Date

Return the current date ${.now}

Return the current date in milliseconds #{.now?long}

Upper Case

${record.paymentmethod?upper_case}

Lower Case

${item.item?lower?case}

Substring

${record.entity.custentity_test?substring(2,8)}

String length

<#if record.entity.test?length ==10>

${memo}

</#if>

Loop line item using list

<#list record.item as itemLine>

${itemLine}

</#list>

Check if name contains

<#if item.item?contains(“Red“)>

<#else>

</#if>

0
Subscribe to my newsletter

Read articles from Anurag Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anurag Kumar
Anurag Kumar

I am a NetSuite Certified SuiteCloud Developer with over 8 years of work experience.