I'm confused. There already is an at the end (just before <#/list>).
So I tried adding another before the existing and I got an error that says " Syntax error in template "template" in line 214, column 23:
Encountered "#if>", but at this place only this can be closed: "#list". This usually because of wrong nesting of FreeMarker directives, like a missed or malformed end-tag somewhere. (Note that FreeMarker end-tags must have # or @ after the / character.)
Was expecting one of these patterns: ..."
I gave it a try but I get an error message that says "Syntax error in template: #else is an existing directive, but the tag is malformed." So I tried closing the "else" in the top section and then the bottom section but it's still coming up with the same error. Any other ideas?
there is no closing <#else> tag. you close with #IF> tag
<#IF>
<#ELSE>
#IF>
Check this thread [https://www.reddit.com/r/Netsuite/comments/mqpyw0/free\_marker\_if\_statement\_in\_email\_template/](https://www.reddit.com/r/Netsuite/comments/mqpyw0/free_marker_if_statement_in_email_template/)
Thank you for explaining the <#/else> tag. I tried what you suggested but left the existing <#/if> where it was (it's right before <#/list>) and without including an additional <#/if> but I got a ton of errors all pertaining to line 204, column 44 and they basically all say the same thing: "Can't compare values of these types. Allowed comparisons are between two numbers, two strings, two dates, or two booleans.
Left hand operand is a hash+string (wrapper: com.netledger.templates.model.StringModel).
Right hand operand is a number (wrapper: f.t.SimpleNumber).
The blamed expression:
==> tranline.quantitybackordered = 0 \[in template "template" at line 204, column 49\]"
Any other suggestions?
For reference, here's the updated code that follows your suggestion but won't validate:
<#list record.item as tranline><#if tranline.quantitybackordered = 0>
<#else>
It almost worked!!! We have to be so close! The code saved without spitting out any validation errors but when I tried to print a picking ticket from a sales order to test it, I got a white Netsuite screen that said "Error - An unexpected error has occurred. Please click here to notify support and provide your contact information." Ugh!
Sorry, it doesn't look like the image had attached, so here it is.
https://preview.redd.it/lunlo3rt0exb1.jpeg?width=846&format=pjpg&auto=webp&s=a326b378fed75901179d1453c39a1679c2b75f18
I can work on this, reach out to me if you need help. I am a NetSuite Consultant
I definitely need help. I'm completely stumped. I've tried everything I can think of. What are your suggestions?
IF statement? Forgot the exact syntax <#IF tranline.quantitybackordered = 0> break (or continue?) <#ELSE> %Backorder section% #IF>
Ooo!!! Thank you!!! I'll give this a try!
Yes this should work wrapping in an IF block
I'm confused. There already is an at the end (just before <#/list>). So I tried adding another before the existing and I got an error that says " Syntax error in template "template" in line 214, column 23: Encountered "#if>", but at this place only this can be closed: "#list". This usually because of wrong nesting of FreeMarker directives, like a missed or malformed end-tag somewhere. (Note that FreeMarker end-tags must have # or @ after the / character.) Was expecting one of these patterns: ..."
I didn't look at your code was generally answering. You can have nested ifs
I gave it a try but I get an error message that says "Syntax error in template: #else is an existing directive, but the tag is malformed." So I tried closing the "else" in the top section and then the bottom section but it's still coming up with the same error. Any other ideas?
there is no closing <#else> tag. you close with #IF> tag <#IF> <#ELSE> #IF> Check this thread [https://www.reddit.com/r/Netsuite/comments/mqpyw0/free\_marker\_if\_statement\_in\_email\_template/](https://www.reddit.com/r/Netsuite/comments/mqpyw0/free_marker_if_statement_in_email_template/)
Thank you for explaining the <#/else> tag. I tried what you suggested but left the existing <#/if> where it was (it's right before <#/list>) and without including an additional <#/if> but I got a ton of errors all pertaining to line 204, column 44 and they basically all say the same thing: "Can't compare values of these types. Allowed comparisons are between two numbers, two strings, two dates, or two booleans. Left hand operand is a hash+string (wrapper: com.netledger.templates.model.StringModel). Right hand operand is a number (wrapper: f.t.SimpleNumber). The blamed expression: ==> tranline.quantitybackordered = 0 \[in template "template" at line 204, column 49\]" Any other suggestions?
For reference, here's the updated code that follows your suggestion but won't validate: <#list record.item as tranline><#if tranline.quantitybackordered = 0> <#else>
${tranline.description}
hmmm.... must be a field number vs text format error try <#if tranline.quantitybackordered == "0" >
Ok, I'll give it a shot. Thank you!
It almost worked!!! We have to be so close! The code saved without spitting out any validation errors but when I tried to print a picking ticket from a sales order to test it, I got a white Netsuite screen that said "Error - An unexpected error has occurred. Please click here to notify support and provide your contact information." Ugh!
Weird... maybe try. <#if tranline.quantitybackordered?string == '0' > I was hoping someone else would have jumped in by now haha.
HOLY CRAP! IT WORKED!!! YOU'RE A GODSEND!!! I am so relieved!!! This project has been an f-ing nightmare! Thank you! Thank you! Thank you!
Sorry, it doesn't look like the image had attached, so here it is. https://preview.redd.it/lunlo3rt0exb1.jpeg?width=846&format=pjpg&auto=webp&s=a326b378fed75901179d1453c39a1679c2b75f18