Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The NetSuite Pro

The NetSuite Pro Logo The NetSuite Pro Logo

The NetSuite Pro Navigation

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Home/ Advanced PDF Templates in NetSuite/Working with Transaction Fields in Advanced PDF

Working with Transaction Fields in Advanced PDF

NetSuite transactions (Invoices, Sales Orders, Purchase Orders, etc.) contain standard fields (like tranid, trandate, entity) and custom fields (defined by your business). With Advanced PDF, you can use FreeMarker syntax to insert these fields into your templates.

This page covers how to display, format, and troubleshoot transaction fields in your Advanced PDF/HTML templates.


πŸ”Ή Displaying Standard Fields

<p>Invoice #: ${record.tranid}</p>
<p>Date: ${record.trandate?string("MMMM dd, yyyy")}</p>
<p>Customer: ${record.entity}</p>
<p>Status: ${record.status}</p>
<p>Total: ${record.total}</p>

βœ”οΈ record = transaction record object
βœ”οΈ ?string() = formats dates


πŸ”Ή Displaying Custom Fields

Custom fields start with custbody_ (body) or custcol_ (line).

<p>Project Code: ${record.custbody_project_code!"N/A"}</p>
<p>Sales Channel: ${record.custbody_sales_channel}</p>

βœ”οΈ Add !"Default" to avoid blank values.


πŸ”Ή Handling Addresses

<h4>Billing Address</h4>
<p>${record.billaddress}</p>

<h4>Shipping Address</h4>
<p>${record.shipaddress}</p>

βœ”οΈ These render multi-line addresses automatically.


πŸ”Ή Accessing Line Item Fields

<table border="1" width="100%">
   <tr>
      <th>Item</th><th>Description</th><th>Quantity</th><th>Rate</th><th>Amount</th>
   </tr>
   <#list record.item as i>
      <tr>
         <td>${i.item}</td>
         <td>${i.description}</td>
         <td>${i.quantity}</td>
         <td>${i.rate?string["#,##0.00"]}</td>
         <td>${i.amount?string["#,##0.00"]}</td>
      </tr>
   </#list>
</table>

βœ”οΈ ${i.item} = Item name
βœ”οΈ ${i.custcol_custom_field} = custom column field


πŸ”Ή Conditional Logic with Fields

<#if record.terms?has_content>
   <p>Payment Terms: ${record.terms}</p>
</#if>

βœ”οΈ Prevents blank labels when no value exists.


πŸ”Ή Example: Transaction Header Section

<div style="font-size:14px; font-weight:bold;">
   Invoice #: ${record.tranid}
</div>
<div>Date: ${record.trandate?string("dd-MMM-yyyy")}</div>
<div>Customer: ${record.entity}</div>
<div>Currency: ${record.currency}</div>
<div>Sales Rep: ${record.salesrep!"Not Assigned"}</div>

πŸ”Ή Troubleshooting Field Issues

  • Blank values β†’ use !"Default"
  • Custom field missing β†’ check form access/permissions
  • Wrong format β†’ use ?string()
  • IDs instead of labels β†’ use @label

Example:

<p>Terms: ${record.terms@label}</p>

βœ… Summary β€” What You Learned

By the end of this page, you now know:

  • βœ… How to insert standard fields like tranid, trandate, entity, and total.
  • βœ… How to display custom body and line fields (custbody_ and custcol_).
  • βœ… How to render addresses directly with ${record.billaddress} and ${record.shipaddress}.
  • βœ… How to loop through line items using <#list record.item as i>.
  • βœ… How to apply conditional logic with <#if> to prevent blank fields.
  • βœ… How to troubleshoot common issues (empty fields, wrong format, ID vs. label).

This gives you a strong foundation to move on to Conditional Logic in Advanced PDF where you’ll apply more complex <#if> and <#switch> rules.

πŸ“– Official Resource: Learn more in the NetSuite Advanced PDF/HTML Templates Guide on Oracle Docs.

Share
  • Facebook

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 8
  • Popular
  • Answers
  • Rocky

    Issue in running a client script in NetSuite SuiteScript 2.0 ...

    • 1 Answer
  • admin

    How can I send an email with an attachment in ...

    • 1 Answer
  • admin

    How do I avoid SSS_USAGE_LIMIT_EXCEEDED in a Map/Reduce script?

    • 1 Answer
  • admin
    admin added an answer The issue is usually caused by following Wrong script file… September 14, 2025 at 10:33 pm
  • admin
    admin added an answer Steps to send an Invoice PDF by email: define(['N/email', 'N/render',… August 28, 2025 at 3:05 am
  • admin
    admin added an answer This error means your script hit NetSuite’s governance usage limit… August 28, 2025 at 3:02 am

Top Members

Rocky

Rocky

  • 1 Question
  • 22 Points
Begginer
Sophie1022

Sophie1022

  • 0 Questions
  • 20 Points
Begginer
jmargoli

jmargoli

  • 0 Questions
  • 20 Points
Begginer

Trending Tags

clientscript netsuite scripting suitescript
  • Migrating a SuiteScript 1.0 RESTlet to SS2.1 + OAuth 2.0 before the 2027.1 deadlineAugust 15, 2026
  • How to convert a SuiteScript 1.0 User Event script to SuiteScript 2.1 (with real code)August 14, 2026
  • The complete SuiteScript 1.0 to 2.1 API cheat sheet: nlapiXxx β†’ N/moduleAugust 13, 2026
  • NetSuite Error Messages: Causes and FixesAugust 11, 2026
  • How to audit every SuiteScript 1.0 script in your NetSuite account (step by step)August 11, 2026
  • SuiteScript 1.0 vs 2.1: a plain-English comparison for NetSuite adminsAugust 10, 2026
  • What NetSuite 2026.2 actually changed β€” the deprecation warnings explainedAugust 9, 2026
  • The 2027.1 NLAuth deadline: why your NetSuite RESTlets are at immediate riskAugust 8, 2026
  • NetSuite is deprecating SuiteScript 1.0 β€” here’s what it means for your businessAugust 7, 2026
  • SuiteScript 1.0 Is Being Phased Out: What It Means and How to PrepareJuly 24, 2026

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Menu

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us

Quick Links

  • NetSuite Scripting
  • NetSuite Customization
  • NetSuite Advanced PDF Template
  • NetSuite Integration
  • NetSuite Reporting & Analytics

Subscribe for NetSuite Insights....

Β© 2026 The NetSuite Pro. All Rights Reserved