0

我正在使用高级 pdf为发票创建打印输出。我试图在“税码”记录中获取与子列表“项目”中的“税码”字段相关的自定义字段的值。我尝试使用 ${item.taxcode.customfield},但在打印输出中出现错误

模板merging.com.netledger.templates.TemplateServiceException期间的异常:模板merging.java.lang.NullPointerException期间的异常请联系您的管理员。

还有另一种方法来操纵我的案子并使其发挥作用吗?

 <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>

谢谢!

4

1 回答 1

0

//假设自定义字段是您实际的 SB/PD 字段的替换。我可能是错的,但可能是您试图“加入”超过 2 条记录吗?不确定 NetSuite 是否允许这样做。

看看你是否可以通过以下方式访问它:

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

或者,您可以在记录的行项目级别上创建字段来源,然后提取该 custcol_* 字段。

于 2018-11-30T13:12:01.207 回答