Search code examples
htmltemplatespdffreemarkernetsuite

In NetSuite, How Do I Print Related Records in Advanced PDF/HTML Template


I created one Invoice in NetSuite. I also accepted a PAYMENT and applied a CREDIT on the Invoice I created. Does anyone know how to print out the related records, which is a "list" type and contains the payment/credit information?

Here is the part of xml of the Invoice:

<machine name="links" type="list" fields="id,trandate,linkurl,type,tranid,status,total">
<line>
<id>167209</id>
<linkurl>/app/accounting/transactions/custpymt.nl?whence=</linkurl>
<status>Deposited</status>
<total>100.00</total>
<trandate>9/18/2017</trandate>
<tranid>PYMT0716</tranid>
<type>Payment</type>
</line>
<line>
<id>167410</id>
<linkurl>/app/accounting/transactions/custcred.nl?whence=</linkurl>
<status>Fully Applied</status>
<total>560.00</total>
<trandate>9/19/2017</trandate>
<tranid>CM0985</tranid>
<type>Credit Memo</type>
</line>
<line>
<id>167410</id>
<total>660.00</total>
<type>Total</type>
</line>
</machine>

Here is what I was trying to do in Advanced PDF Template:

<#if record.links?has_content>
      <table class="itemtable" style="width: 100%;">
        <#list record.links as lineitem>
          <#if lineitem_index==0>
            <thead>
              <tr>
                <th align="center">type</th>
                <th align="center">total</th>
              </tr>
            </thead>
          </#if>
          <tr>
            <td align="center" class="itemInfo">${lineitem.type}</td>
            <td align="center" class="itemInfo">${lineitem.total}</td>
          </tr>
        </#list>
      </table>
  </#if>

Solution

  • I haven't seen a way to do this. I think it can't be done.