RE: Troubleshooting Advanced PDF code

Hi. I have the following bit of code in an advanced PDF (Multi Currency Statement):

<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">

<pdfset><#if statements?has_content><#list statements as record>

<pdf>

<head>

<#assign earliestDate = "12/31/3000"?date("MM/dd/yyyy")> <!-- Assumes that no date in the list will be later than Dec 31 3000 -->

<#list record.lines as line>

<#if (line.datecol < earliestDate)>

<#assign earliestDate = line.datecol>

</#if>

</#list>

This is supposed to pick the earliest date from all of the dates in the list of activities for the statement

This returns the correct value though I cannot get it to display on the pdf’s header section (just underneath the company logo)

Instead it displays in a random part of the body of the pdf

Troubleshooting Advanced PDF code

How do I get this to display just underneath the company logo? if I use the ${record.earliestDate} field anywhere in the header, it does not display anything at all

Lefemmenikita Rookie Asked on June 11, 2021 in SuiteBuilder.
Add Comment
1 Answers

You don’t want ${record.earliestdate} as it’s not a field that you’re accessing from the record – just use ${earliestDate} since it’s a variable you defined yourself. And to print it in the header, you need to put it in the part of the PDF code between <macro id=”nlheader”> and </macro> (should be near the top of the code).

Rookie Answered 7 days ago.

Thank you! That works

6 days ago.
Add Comment

Your Answer

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