When evaluating a custom Boolean field (e.g., custentity_custom_field) in a condition, it should be compared as a Boolean, not as a string.
Incorrect Comparison:
<#if record.custentity_custom_field == "T">
This comparison will result in an error because custentity_custom_field is a Boolean, while "T" is a string.
Correct Comparison:
<#if record.custentity_custom_field>
Here, the field is evaluated directly. If it holds a true value, the condition will be satisfied.