RE: Hello Experts! How to Reference Custom Fields in Grouped Invoices Using Advanced PDF/HTML Templates?

We have created a template for group invoices but unable to get “Description” field in print. Is there anyway to get that field?

Haris Beginner Asked on January 27, 2021 in How To's.
Add Comment
2 Answers

You can add data to an Advanced PDF template in SuiteScript using the ‘addCustomDataSource’ method on the report object:

var invoiceGroupInvoiceReportRows = { groupedinvoices_summary: [<your data>] };
var invoiceDetailReportRows = { invoice_details: [<your data>] };
    format: render.DataSource.OBJECT,
    alias: 'results',
    data: invoiceGroupInvoiceReportRows

Then reference that data in the report XML like this:


For example:

<#list results.groupedinvoices_summary as invoice>

Here’s a link to the Adobe FreeMarker docs:







Rookie Answered on March 26, 2021.

To clarify, you would add the first section of code to your PDF source code?    Can you please show how this would work to expose specific fields from the invoice to the invoice group pdf, like line description, and createdfrom?  These are seeded fields that are not available in the invoice group PDF, and will assume that any custom fields would work similarly.

on May 26, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.