Well, after going through the usual process of being frustrated by NetSuite support and their inability to support their own platform, I'm looking for a solution to this problem from other users that may have already solved it.
We have string literals for line feed (\n) in the purchasedescription field of items. When Freemarker renders the output, the line feed literal is converted to "<br>". Good so far. That's a nice plus.
My issue is that I want to be able to format the output, as it contains label and value strings, i.e. "Finish: Brass". For many items, there are more than one descriptor like this, i.e. "Finish: Brass\nColor: Red". The goal is to apply a style to all of the labels. I have tried every combination of characters in the ?split to try to accomplish a new variable to no avail.
Here is what is in place:
Custom column in the items sublist sourcing purchasedescription:
<#assign itemvars = item.custcol_description_attributes>
<#if itemvars != "" && itemvars?contains("\n")>
<#list itemvars?split("\n") as variation>
<#assign varlabel = "">
<#assign varvalue = "">
<#if variation?contains(":")>
<#assign varlabel = variation?substring(0,variation?index_of(":"))>
<#assign varvalue = variation?replace(varlabel,"")?trim>
<span class="c33">${varlabel}</span> ${varvalue}<br />
<#else>
${variation}<br />
</#if>
</#list>
<#elseif itemvars != "">
<#assign varlabel = "">
<#assign varvalue = "">
<#if itemvars?contains(":")>
<#assign varlabel = itemvars?substring(0,variation?index_of(":"))>
<#assign varvalue = itemvars?replace(varlabel,"")?trim>
<span class="c33">${varlabel}</span> ${varvalue}<br />
<#else>
${itemvars}<br />
</#if>
</#if>
I have tried "\n", "\\n" and "<br>", but none of then produce the expected result. Every value results in the elseif condition being used. Does anyone have the magic word to figure out how to actually utilize the string literal for line feed in a Freemarker buil-in?