7px
06/20/2023, 2:36 AM<#if>
statement?
for context, i've created a simple xml template in a Suitelet and am trying to print out a Customer Payment
record onto this xml template. So far it works, but the output is currently printing out a lot of items in the apply
sublist, but I only want the one item with a value in the amount
column *(which is also the only item in the record's sublist anyway).
i guess a follow-up question would be if there is a way to filter out items that get filled in by the <#list>
feature? I'd appreciate any and all input.David B
06/20/2023, 3:05 AM<#if>
. See if, else, elseif and Logical operations
if you want to filter for only items in the apply sublist that have a value in amount you can either:
• <#list>
the whole apply sublist and only print when <#if apply.amount?has_content && apply.amount gt 0>
• use the ?filter builtin for sequences to pre filter your #list
. Something like <#list record.apply?filter(x -> x.amount?has_content && x.amount gt 0) as apply>
David B
06/20/2023, 3:07 AM7px
06/20/2023, 6:41 AM