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 5
  • 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
  • NetSuite AI in 2026: How Oracle Is Transforming ERP with Artificial IntelligenceMay 29, 2026
  • Common NetSuite Errors: What They Mean and How to Fix ThemMay 28, 2026
  • NetSuite Date Formatting Issues: Common Errors When Setting Date Values in SuiteScriptMay 28, 2026
  • NetSuite Customization Best Practices: Building Scalable and Maintainable SolutionsMay 26, 2026
  • NetSuite Next: The Future of AI-Enabled ERPMay 25, 2026
  • SuiteScript Code Assist: A Developer’s New Best FriendMay 24, 2026
  • NetSuite Planning Copilot: Scenario Forecasting Made EasyMay 23, 2026
  • AI-Powered Close Management in NetSuite 2026May 22, 2026
  • Advanced PDF Templates in NetSuite: Performance Optimization and Best PracticesMay 22, 2026
  • N/search vs N/query in SuiteScript 2.1 β€” When to Use WhichMay 22, 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