The quick answer
If your checkbox is a boolean in the template data model, compare it with true, without quotes, or use the checkbox directly as the condition. Wrap the complete row in the condition. Save the template, then print a saved Sales Order with the checkbox checked and cleared to verify both results.
Person and operating-company names in these screenshots are fictional example data.
Before you start
This walkthrough uses a simple custom Advanced PDF/HTML template. Its layout is defined by that custom source. The named form, template, fields and test order already exist.
This example uses an existing stored transaction body checkbox, Show Delivery Note, with ID custbody_show_delivery_note, and a text field, Delivery Note, with ID custbody_delivery_note. Both fields already apply to sales transactions and appear on the test order. The note reads Call the receiving desk before arrival.
You need Advanced PDF/HTML Templates and permission to edit the template and order, and to view and print the Sales Order. Confirm that the saved order's custom form uses Advanced printing and the template you are changing. Here, Delivery Sales Order uses Conditional Delivery Sales Order. Work on a controlled test template and form before changing customer-facing output.
The condition below assumes a boolean checkbox value. Field visibility and the template data model can affect the type NetSuite exposes. Check that type before applying this expression to a different form or field.
01. Inspect the comparison
Open the assigned template under Customization > Forms > Advanced PDF/HTML Templates. Select Source Code and find the checkbox condition.
This version compares a boolean with the string "T". When the template model supplies a boolean, the comparison can produce a FreeMarker type-mismatch error.
02. Use a boolean condition
Replace "T" with true. Keep the label and value inside the condition so the entire row disappears when the checkbox is clear.
<#if record.custbody_show_delivery_note == true>
<tr>
<td>Delivery Note</td>
<td>${record.custbody_delivery_note}</td>
</tr>
</#if>
Click Preview. In this example, the sample checkbox is checked and the note appears. Preview validates the source against sample data; it does not let you choose arbitrary checkbox values on a saved order. Close the preview after checking it.
03. Save the template
Choose Save and Edit from the save menu. Confirm Template was successfully saved. This saves the source change and leaves the editor open. It does not change the checkbox on any Sales Order.
04. Print the checked order
Open SO-8406 from Recent Records, or search for the order if it is not listed there. Confirm Show Delivery Note is checked and the receiving-desk instruction is present.
Click Print. The output includes both the Delivery Note label and its text. This uses the saved order through its form's assigned print template. Close the preview.
05. Clear the checkbox and print again
Click Edit, clear Show Delivery Note, and save the same order. Leave the instruction unchanged.
Print the order again. SO-8406, its customer and its total remain. The whole delivery-note row is absent, including its label. The note is still stored on the order; the condition controls whether it prints. This check verifies the conditional row in this custom printout.
If both prints look identical, check the saved checkbox value, actual field IDs, active custom form and assigned print template. If the comparison still produces an error, inspect the field's data type in that template model.
Common questions
Should I compare every NetSuite checkbox with true?
Use a boolean condition when the template receives a boolean. A field exposed as a string needs a condition appropriate to its actual value. Confirm the model type and representation rather than assuming every checkbox is the string T.
Can I use the checkbox directly without comparing it with true?
Yes, when the value is boolean. Put the checkbox expression directly after the if directive. Comparing it with true makes the expected type explicit in this example.
Why should the condition wrap the entire table row?
Hiding only the field value can leave its label, borders or empty cells behind. Wrapping the complete row makes all of those elements conditional together.
Does editor Preview prove the saved order will print correctly?
Preview checks sample data. Confirm the order's custom form and assigned template, save the order's checkbox value, then use its Print action to test checked and cleared cases.