I'm getting an <error> message on this pdf code. I...
# advancedpdf
l
I'm getting an error message on this pdf code. It doesn't seem to like having a < inside the assign tag. Any other way to achieve this? <#assign originalAmount = <#if line.description?contains("Invoice")>${line.charge} #else ${line.payment}</#if>)> ${originalAmount - line.payment}
m
Copy code
<#if line.description?contains("Invoice")>
  <#assign originalAmount = line.charge>
<#else>
  <#assign originalAmount = line.payment>
</#if>

${originalAmount - line.payment}
l
I will try this. Thank you!
Unfortunately, it gets saved but throws an unexpected error when actually printing it
s
put
<#assign originalAmount = 0/>
before the if statement. also close each assign statement with a slash
<#assign originalAmount = line.charge */*>
<#assign originalAmount = line.payment */*>
l
Thank you. I’ll try this.
n
Appreciate this is weeks ago but only just read it and it's bugged me. Why are you suggesting @Stefan Reeder closing with a forward slash? That's not standard freemarker syntax as far as I'm aware? https://freemarker.apache.org/docs/ref_directive_assign.html
s
@NElliott Force of habit. I had a bug or glitch or whatever you wanna call it a couple of years ago that was resolved by using
<#assign var = 1234 />
instead of
<#assign var = 1234 >
Also pays to keep in mind, NetSuite may not be using the absolute latest version of Freemarker, so it's not 100% per documentation.
netsuite 1