didnt get a reply from <#C466X49JB|> so ill ask he...
# suitescript
s
didnt get a reply from #C466X49JB so ill ask here. Anyone ever declare variables and do math within the template? Freemarker documentation is hurting my brain.
n
I haven't worked with pdf templates yet. But I'll suggest that when you cross post from channels you share the original message rather than copy/pasting, that way people in both channels can share the same thread
👍 1
n
Math is doable in Freemarker. What are you trying to do
e
there is decent documentation here- https://freemarker.apache.org/docs/pgui.html but describing exactly what you're trying to do would help us help you
s
Yea ive been going through the documentation. Markup language terminology is new to me so its confusing. For my scenario, im trying to have a BOM contain a column that shows qty of part/assembly. Ex. An Assembly consists of ten items A BOM is generated that requires ten Assemblies to be built The pick list table would look like this:
was thinking something like this: <table class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>     <thead>         <tr>            <th align="left" colspan="10" padding-left="60px">${item.item@label}</th>         <th align="center" colspan="2">Qty</th>         <th align="center" colspan="2">Qty/Unit</th>         <th align="center" colspan="1">Pick</th>         </tr>     </thead>     </#if><tr>             <td colspan="12">${item.custcol_item_id} ${item.description}</td>             <td align="right" colspan="2" line-height="100%">${item.quantity} ${item.units}</td>             <#assign x = item.quantity / record.quantity>             <td align="right" colspan="2" line-height="100%">${x}</td>             <td colspan="1"></td>         </tr>         </#list><!-- end items --></table>     <br /></#if>
havent actually tried it yet so may be some syntax errors
oh it works. Thanks for the help