Reputation: 25
Can anyone guide me on how to declare variables? I want to store the field values(not empty) in 1 variable then displays it.
${record.createdfrom.entity.shipaddressee} ${record.createdfrom.entity.shipcountry} ${record.shipcity}
Above is the fields that I've been using. I really have no Idea on how to do this.
Upvotes: 2
Views: 3247
Reputation: 91
you can use <#assign> for example <#assign count = 0> this will assign '0' to the variable count
Upvotes: 0
Reputation: 304
https://freemarker.apache.org/docs/index.html
You have to keep in mind that NetSuite is currently only using FreeMarker Version 2.3.26-incubating. Some of the options may not be available that are found in the documentation.
Upvotes: 2
Reputation: 2250
Here are a couple of examples from one of my PDFs.
<#assign showPrices=record.custbody_hs_show_line_item_prices>
<#assign discounts=[]>
<#assign discountsCount=0>
<#assign discountStr="">
<#assign lineValues={}>
<#assign discounts=discounts+[{"item":item.item,"amount":item.amount}]>
<#assign lineValues=lineValues+{"item":item.item,"description":item.description,"quantity":0,"rate":0,"amount":0,"taxrate":item.taxrate1,"billCycle":item.billingcycle}>
That should give you an idea of the different types of assignment statements.
Upvotes: 1