RE: How to use a check box as a condition in an IF statement in a Advanced PDF/HTML temple

I have a custom check box on a sales order and if this is checked I want another custom field to display on the sales order PDF. I have tried the below IF statement but it is throwing an error. How do I check if a checkbox is ticked in an IF statement?

 

<#if record.custbody_custom_address == “T”>${record.custbody_entity_id}</#if>

Margie Beginner Asked on October 1, 2020 in Partners.
Add Comment
2 Answers
Just for future reference: To Solve errors while using condition on Checkbox in PDF template like 'For "#if" condition: Expected a boolean, but this has evaluated to a sequence+hash+string' etc.
<#if (record.custbody_specialitem?is_boolean && record.custbody_specialitem) || (record.custbody_specialitem?is_string && record.custbody_specialitem == 'T')
Rookie Answered on July 6, 2022.
Add Comment

Your Answer

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