When rendering a pdf, anything inside of <#list...
# suitescript
n
When rendering a pdf, anything inside of <#list record.item as item> doesn't print for some reason.
b
what you shared looks okay
you need to share more of the template
n
@battk that is pretty much it. When you print the invoice regular the lines show. But when printing using the SL it doesn't. Here is the part in the advanced pdf that doesn't work:
Copy code
<#list record.item as item>
<#if item.custcol_nco_woline_job_code?has_content><#elseif item.custcol_nco_wo_job == jobName><#assign partsTotal = partsTotal + item.amount><#if item.custcol_nco_invoice_offset?string == "No">
<tr>
    <td colspan="2"></td>
    <td colspan="2" align="right">${item.custcol_nco_wo_part_num?upper_case}</td>
    <td colspan="6" align="left">${item.description?upper_case}</td>
    <td colspan="1" align="center">${item.quantity}</td>
    <td colspan="2" align="right">${item.rate}</td>
    <td colspan="2" align="right">${item.amount}</td>
</tr></#if></#if></#list>
b
you didnt share enough information to decode the if statement
if you are sure it works, remove it from the template
n
so i tried just printing table row inside the list and nothing still
b
do more simple
n
things outside of list like ${record.entityid} print fine. it's just anything like this doesn't
Copy code
<#list record.item as item>
${item.amount}
<#list>
b
use a simple template
like
Copy code
<#list record.item as item>${item.amount}</#list>
nothing else
then render it as a string
n
what, render item.amount as string within list?
like
Copy code
${item.amount?string}
b
use a template which is literally only
<#list record.item as item>${item.amount}</#list>
log the output
n
hm how would i modify my current suitlet to do renderAsString
b
use log.debug
you dont need to make a pdf file
n
it outputs the info
so that is odd
not sure why my pdf doesn't
b
fair chance its the rest of the template
n
Copy code
<tr>
    <td colspan="2">PARTS</td>
    <td colspan="2"><#list record.item as item>
test: ${item.amount}
    </#list></td>
    <td colspan="6"></td>
    <td colspan="1"></td>
    <td colspan="2"></td>
    <td colspan="2"></td>
</tr>
  
<#list record.item as item>
<#if item.custcol_nco_woline_job_code?has_content><#elseif item.custcol_nco_wo_job == jobName><#assign partsTotal = partsTotal + item.amount><#if item.custcol_nco_invoice_offset?string == "No">
<tr>
    <td colspan="2"></td>
    <td colspan="2" align="right">${item.custcol_nco_wo_part_num?upper_case}</td>
    <td colspan="6" align="left">${item.description?upper_case}</td>
    <td colspan="1" align="center">${item.quantity}</td>
    <td colspan="2" align="right">${item.rate}</td>
    <td colspan="2" align="right">${item.amount}</td>
</tr></#if></#if></#list>
so under Parts at the top. that prints the values. Why wouldn't the list underneath print?
so testing i removed the if statements and it prints.
i think you set me on the right path for debugging this @battk so thanks! I'll take it from here