0

I am creating a print out for Invoice using advanced pdf. I'm trying to get a value of a custom field in the "Tax code" record which is related to the field 'Tax code' in the sublist 'Item'. I tried with ${item.taxcode.customfield}, but in the print out, I have an error

Exception during template merging.com.netledger.templates.TemplateServiceException: Exception during template merging.java.lang.NullPointerExceptionPlease contact your administrator.

Is there another way to manipulate my case and make it work ?

 <table class="total" style="width: 100%; margin-top: 10px;" border="2">
    <#list record.item as item><#if item_index==0>
     <tr>
   <th colspan="5"  line-height="150%" style="font-weight: bold;background-color: rgb(255, 255, 255);padding: 4x 2px;">Tax Code Message</th>
  </tr>
  <tr>
       <td ><#if item.taxcode?contains("VAT:")><#assign taxcode>${item.taxcode?replace("VAT:","")}</#assign>${taxcode}<br/>${item.taxcode.customfield}</#if></td>
   <td ></td>
   <td ></td>
  </tr>
  <tr>
   <td ></td>
   <td ></td>
   <td ></td>
  </tr>
    </#if></#list>
  </table>

Thanks!

spring_flower
  • 71
  • 1
  • 1
  • 9

1 Answers1

0

//assuming customfield is a replacement of your actual SB/PD field. I could be wrong, but could it be that you are trying to 'join' more than 2 records? Not sure NetSuite allows that.

See if you could access it with the following:

record.field?has_content
... <#assign... 
    <#list item as items
        <#list items.taxCode as itemTaxCode>
        <{itemTaxCode.customfield}>

Or you could do a source of the field on the line-item level of the record, then pull that custcol_* field.

Mykola Z.
  • 1
  • 1