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
    • Advanced PDF Templates in NetSuite
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • Advanced PDF Templates in NetSuite
  • 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.

Share
  • Facebook

Leave a ReplyCancel reply

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 2
  • 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
  • 21 Points
Begginer
admin

admin

  • 5 Questions
  • 2 Points

Trending Tags

clientscript netsuite scripting suitescript

Explore

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

Footer

© 2025 The NetSuite Pro. All Rights Reserved