Advanced PDF - use an if statement to check whethe...
# ask-stanley-ai
a
Advanced PDF - use an if statement to check whether a checkbox is ticked or not
c
AI generated answer (using internal Slack threads):
In Advanced PDF/HTML templates in NetSuite, you can use FreeMarker syntax to check if a checkbox field is checked or not. The checkbox field in NetSuite returns either 'T' or 'F' string value, where 'T' means the checkbox is checked and 'F' means it is not checked. Here is an example of how you can use an if statement to check whether a checkbox is ticked or not:
Copy code
freemarker
<#if record.custX == 'T'>
    <!-- Your code here if the checkbox is checked -->
<#else>
    <!-- Your code here if the checkbox is not checked -->
</#if>
In this example,
record.custX
is the checkbox field. Replace
custX
with the actual field id of your checkbox field. The
== 'T'
checks if the checkbox is checked. If it is, the code inside the first block will be executed. If it is not checked, the code inside the
else
block will be executed. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819930136
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811421335
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796550155
Please provide your feedback on this answer.