Netsuite/Freemarker-访问电子邮件模板中的事务行级数据

Netsuite/Freemarker-访问电子邮件模板中的事务行级数据,netsuite,freemarker,Netsuite,Freemarker,我正在尝试使用当前的电子邮件模板,我的组织使用该模板根据客户当前的挂起交易请求订单押金,这样freemarker就可以很好地抓取${transaction.tranId}等 我有一个新的要求,抓取一个交易行级别的超链接,并将其与电子邮件请求一起发送出去,但我只想在数据存在时发送它,并且只发送链接应用于的项目 <#if (record.item.custcol1)?has_content> <p><strong>Please re-review the

我正在尝试使用当前的电子邮件模板,我的组织使用该模板根据客户当前的挂起交易请求订单押金,这样freemarker就可以很好地抓取${transaction.tranId}等

我有一个新的要求,抓取一个交易行级别的超链接,并将其与电子邮件请求一起发送出去,但我只想在数据存在时发送它,并且只发送链接应用于的项目

<#if (record.item.custcol1)?has_content>

    <p><strong>Please re-review the following artwork proof link(s) associated with your order:</strong></p>

    <table style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item>
    <thead>
        <tr>
        <th align="left" colspan="3" style="padding: 10px 6px;">${item.custcol1@label}</th>
        </tr>
    </thead>
    <tbody>
        <tr>
        <td align="left" colspan="3" line-height="150%">${item.custcol1}</td>
        </tr>
        </#list><!-- end items -->
    </tbody>
    </table>

    <hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#if>

请重新查看与您的订单相关的以下艺术品校对链接:

${项。custcol1@label} ${item.custcol1}
我似乎不能像在PDF表单中那样访问行级数据。我在已知记录上尝试了没有if语句的代码,我知道我有数据要访问,但它不会将字段拉入电子邮件。

看起来您的
应该只在表行周围,如下所示:

<table style="width: 100%; margin-top: 10px;">
    <thead>
        <tr>
        <th align="left" colspan="3" style="padding: 10px 6px;">${item.custcol1@label}</th>
        </tr>
    </thead>
    <tbody>
        <#list record.item as item>
        <tr>
        <td align="left" colspan="3" line-height="150%">${item.custcol1}</td>
        </tr>
        </#list>
    </tbody>
</table>

${项。custcol1@label}
${item.custcol1}

如果我正确阅读并理解您的需求,您应该在
中包含
块-您希望测试每个项目上的字段内容,而不是将整个项目列表作为一个块。另外,
record.item.custcol1
将无效-您需要为要测试的项提供索引,例如:
record.item[0].custcol1
,如果这是您想要的。