Simon G
Simon G

Reputation: 217

Netsuite Advanced PDF/HTML code ifelse statement

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.

Upvotes: 1

Views: 7702

Answers (1)

w3bguy
w3bguy

Reputation: 2250

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>

Upvotes: 3

Related Questions