Netsuite Advanced PDF/HTML code ifelse statement

2020-04-20 06:36发布

问题:

I need some assistance in the correct way to format this code for a item fulfillment in Netsuite;

  <td><#if item.units != null>Units<#else>${tranline.units}</#if></td>

I want the PDF form to show the Units of Measure (i.e. units) and if there is no particular UOM specificied for the item, to say UNITS instead of displaying nothing.

回答1:

Your example looks correct to me, aside from the values being in the wrong places. In my PDF templates, I do not use NULL, either. Below is how I have a similar item written.

<#if item.units=="">
  Units
<#else>
  ${tranline.units}
</#if>