title: NS Advanced PDF/HTML Template
body: <p>I am creating a print out for <strong>Invoice</strong> using advanced pdf. I'm trying to get a value of a custom field in the <strong>"Tax code"</strong> 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</p>
  
  <blockquote>
    <p>Exception during template merging.com.netledger.templates.TemplateServiceException: Exception during template merging.java.lang.NullPointerExceptionPlease contact your administrator.</p>
  </blockquote>
  
  <p>Is there another way to manipulate my case and make it work ?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;table class="total" style="width: 100%; margin-top: 10px;" border="2"&gt;
      &lt;#list record.item as item&gt;&lt;#if item_index==0&gt;
       &lt;tr&gt;
     &lt;th colspan="5"  line-height="150%" style="font-weight: bold;background-color: rgb(255, 255, 255);padding: 4x 2px;"&gt;Tax Code Message&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
         &lt;td &gt;&lt;#if item.taxcode?contains("VAT:")&gt;&lt;#assign taxcode&gt;${item.taxcode?replace("VAT:","")}&lt;/#assign&gt;${taxcode}&lt;br/&gt;${item.taxcode.customfield}&lt;/#if&gt;&lt;/td&gt;
     &lt;td &gt;&lt;/td&gt;
     &lt;td &gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
     &lt;td &gt;&lt;/td&gt;
     &lt;td &gt;&lt;/td&gt;
     &lt;td &gt;&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/#if&gt;&lt;/#list&gt;
    &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks!</p>