π What Are Advanced PDF Templates?
Advanced PDF/HTML Templates let you design custom print and email layouts for NetSuite records.
Instead of relying on standard layouts, you can use FreeMarker markup + HTML/CSS to build professional, branded templates.
They are commonly used for:
- Invoices
- Sales Orders & Quotes
- Packing Slips & Shipping Labels
- Statements
π§ Key Features
- Full control of layout and styling with HTML & CSS.
- Use FreeMarker syntax to insert dynamic NetSuite fields.
- Apply conditional logic (e.g., show VAT fields only for EU customers).
- Support for multi-subsidiary branding (different logos, addresses).
- Insert custom fields into printed/email forms.
βοΈ Steps to Create an Advanced PDF Template
- Go to Customization > Forms > Advanced PDF/HTML Templates > New.
- Choose a record type (e.g., Invoice).
- Either:
- Start with a blank template, or
- Customize an existing one.
- Use the built-in editor to add HTML, CSS, and FreeMarker code.
- Preview the template using sample data.
- Assign the template to a custom or standard form.
β Example: Custom Invoice Template
Scenario: You want to create a branded invoice that includes company logo, customer name, line items, and a conditional βPaid in Fullβ stamp.
Code Snippet:
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; font-size: 12px; }
.header { text-align: center; }
.paid { color: green; font-size: 18px; font-weight: bold; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ccc; padding: 5px; }
</style>
</head>
<body>
<div class="header">
<img src="${companyInformation.logoUrl}" alt="Company Logo" height="50"/>
<h2>Invoice</h2>
</div>
<p><b>Customer:</b> ${record.entity}</p>
<p><b>Date:</b> ${record.trandate}</p>
<p><b>Invoice #:</b> ${record.tranid}</p>
<table>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Rate</th>
<th>Amount</th>
</tr>
<#list record.item as i>
<tr>
<td>${i.item}</td>
<td>${i.quantity}</td>
<td>${i.rate}</td>
<td>${i.amount}</td>
</tr>
</#list>
</table>
<#if record.total == record.amountpaid>
<p class="paid">Paid in Full</p>
</#if>
<p><b>Total:</b> ${record.total}</p>
<p><b>Amount Paid:</b> ${record.amountpaid}</p>
<p><b>Balance Due:</b> ${record.balance}</p>
</body>
</html>
π This template displays invoice details and conditionally shows βPaid in Fullβ if the balance is zero.
π Common FreeMarker Syntax
- Insert Field β
${record.fieldid}
- Loop through sublist β
<#list record.item as i>
- If condition β
<#if record.total > 1000>High Value</#if>
- Company Info β
${companyInformation.companyName}
,${companyInformation.logoUrl}
π‘ Pro Tips & Best Practices
- Use inline CSS for consistent formatting across browsers.
- Always preview with sample transactions before deploying.
- Store logos in the File Cabinet and reference them dynamically.
- Document custom templates β especially if tied to subsidiaries.
- Keep multiple versions for testing before replacing a live invoice.
π Key Takeaways
- Advanced PDF Templates give you full control over NetSuiteβs printed and emailed documents.
- FreeMarker + HTML/CSS allows for dynamic data, loops, and conditions.
- Always preview and test before assigning to live forms.
- Combine with custom fields for maximum flexibility.
π Next Page: SuiteBuilder vs SuiteScript: When to Use Which
Leave a Reply