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/Adding Custom Fields in Advanced PDF

Adding Custom Fields in Advanced PDF

NetSuite allows you to create custom fields to capture business-specific data (like project codes, VAT numbers, or delivery notes). These fields can also be pulled into your Advanced PDF/HTML templates using FreeMarker.

This page covers how to insert, format, and troubleshoot custom fields in both header (body) and line item sections.


🔹 Understanding Custom Field IDs

  • Body (header-level) custom fields → start with custbody_
  • Column (line-level) custom fields → start with custcol_
  • Entity custom fields → start with custentity_
  • Transaction fields on items → accessible within <#list record.item as i>

🔹 Displaying Custom Body Fields

<p>Project Code: ${record.custbody_project_code!"N/A"}</p>
<p>Customer PO: ${record.custbody_customer_po!"Not Provided"}</p>

✔️ The !"Default Text" prevents blank outputs.


🔹 Displaying Custom Line Item Fields

Within the item loop:

<table border="1" width="100%">
   <tr>
      <th>Item</th>
      <th>Description</th>
      <th>Warranty</th>
      <th>Custom Note</th>
   </tr>
   <#list record.item as i>
      <tr>
         <td>${i.item}</td>
         <td>${i.description}</td>
         <td>${i.custcol_warranty_period!"-"}</td>
         <td>${i.custcol_custom_note!"N/A"}</td>
      </tr>
   </#list>
</table>

✔️ ${i.custcol_warranty_period} pulls a custom column field.


🔹 Conditional Display of Custom Fields

<#if record.custbody_special_instructions?has_content>
   <p><b>Special Instructions:</b> ${record.custbody_special_instructions}</p>
</#if>

✔️ Avoids printing a blank line if no value exists.


🔹 Using Labels Instead of Internal IDs

Sometimes custom fields show internal IDs instead of labels. To display the label:

<p>Payment Terms: ${record.terms@label}</p>
<p>Sales Channel: ${record.custbody_sales_channel@label}</p>

✔️ @label retrieves the display value instead of the ID.


🔹 Formatting Custom Field Values

You can format numbers and dates from custom fields:

<p>Estimated Delivery: ${record.custbody_est_delivery_date?string("MMMM dd, yyyy")}</p>
<p>Custom Amount: ${record.custbody_total_discount?string["#,##0.00"]}</p>

🔹 Example: Custom Header Section

<div style="margin-top:10px; font-size:12px;">
   <p>Project Code: ${record.custbody_project_code!"N/A"}</p>
   <p>VAT Number: ${record.custbody_vat_number!"Not Available"}</p>
   <p>Delivery Instructions: ${record.custbody_delivery_note!"None"}</p>
</div>

✅ Best Practices

  • Always use !"Default" or ?has_content for cleaner outputs.
  • Use @label to display the readable value.
  • Test with multiple records — some fields only populate under certain conditions.
  • Keep custom field internal IDs consistent across templates.

✅ Summary — What You Learned

By the end of this section, you know how to:

  • ✅ Insert custom body fields (custbody_).
  • ✅ Insert custom line fields (custcol_) inside item tables.
  • ✅ Use conditional checks to avoid blank outputs.
  • ✅ Display labels instead of raw internal IDs.
  • ✅ Format dates and numbers from custom fields.

This prepares you for the next section: Multi-Subsidiary & Multi-Currency PDFs, where you’ll learn to handle different legal entities, tax IDs, and currencies in one template.

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