RE: Advanced PDF print statement when a condition is met

Using advanced pdf, I am trying to modify a picking sheet to print a statement when {shipcomplete} is Yes. I am using the <#if> but have issues when the field is null.

I tried the following

<#if record.shipcomplete?has_content>

<#if record.shipcomplete == “Yes”>

SHIP COMPLETE

</#if></#if>

When I do so, I receive the error below.

If the failing expression is known to legally refer to something that’s sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??

I am not familiar with the myoptionalvar and do not know how to incorporate it into the picking sheet.

Any help will be greatly appreciated.

MidwestUser Rookie Asked on August 7, 2023 in Other.
Add Comment
6 Answers

https://freemarker.apache.org/docs/ref_depr_builtin.html

Beginner Answered on August 9, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.