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?

Beginner Asked on January 27, 2021 in How To's.
Add Comment
2 Answer(s)

Hi Haris,

We created a custom invoice form,  so when they require only to show a description on the invoice, they can fill out a custom field, “Summary Description” we then matched this field on a custom Adv. PDF template, so the customer facing form only show the summary description instead of an item list.

(obviously this only work if you are showing one description line)

 

Rookie Answered on January 27, 2021.
Add Comment

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>] };
xmlReport.addCustomDataSource({
    format: render.DataSource.OBJECT,
    alias: 'results',
    data: invoiceGroupInvoiceReportRows
})

Then reference that data in the report XML like this:

results.groupedinvoices_summary

For example:

<#list results.groupedinvoices_summary as invoice>
...
</#list>

Here’s a link to the Adobe FreeMarker docs: https://freemarker.apache.org/docs/index.html

 

 

 

 

 

 

Rookie Answered on March 26, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor