Aly
04/03/2025, 11:06 PMCeligo AI
04/03/2025, 11:07 PMAI generated answer (using internal Slack threads):The row is still showing when the field is empty because the
has_content
method in FreeMarker checks if the sequence (string, list, etc.) is not null and has a length greater than zero. It doesn't check if the string only contains whitespace (spaces, tabs, newlines, etc.).
To hide the row when the field is empty or contains only whitespace, you can use the ?trim
built-in function in FreeMarker to remove leading and trailing whitespace from the string, and then check if it has content. Here's how you can modify your code:
html
<#if record.custentity_md_amt_to_be_credited?trim?has_content>
<tr>
<td style="border: 0.5px solid #000; padding: 4px;">
<b>Amount to be Credited</b>
</td>
<td style="border: 0.5px solid #000; padding: 4px;">
<b>${record.custentity_md_amt_to_be_credited}</b>
</td>
</tr>
</#if>
This will ensure that the row is hidden when the custentity_md_amt_to_be_credited
field is either null, empty, or contains only whitespace.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/03/2025, 11:07 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830382824
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.80719018
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805625081
Celigo AI
04/03/2025, 11:07 PM