I have a custom transaction body field (called `cu...
# general
j
I have a custom transaction body field (called
custbody_addtional_clauses
) of type Long Text (I would use Rich Text but the value is generated by a custom Workflow Action Script, and Rich Text is not an option for a return parameter in a script). This text contains HTML formatted data, e.g.
<b>this is some bold text</b> and this part is not bold
The content of this field will be included as part of the Advanced PDF/HTML template. When I try to use this field in the Advanced PDF/HTML Template, I cannot get it to correctly display the HTML. If I just use ${record.custbody_additional_clauses} somewhere in my template, it literally shows
<b>here is some bold text</b> and this part is not bold
(with the angled brackets) instead of showing
here is some bold text and this part is not bold
(with “here is some bold text” in bold). I think this is because NetSuite CHANGES the value of the Long Text field and replaces angled brackets with HTML entities, e.g. changing
<
to
<
I’ve tried many different things to try to get this to work, e.g. ${record.custbody_additional_clauses?html}, using #noescape, and using ${record.custbody_additional_clauses?replace(“<“, “<”)?replace(“>“,”>“) No matter what I try, when using a Long Text field, I cannot get it to display properly when the transaction is printed. I either get an error message when I try to print, or the text appears with the angled brackets showing instead of being interpreted as HTML. Does anyone have any suggestions? Note that if the field is of type Rich Text it DOES work....but then I cannot actually set the value via Workflow Action which is required.
e
You could try
Copy code
<#outputformat "HTML">
	${record.custbody_additional_clauses?no_esc}
</#outputformat>
j
unfortunately it still comes out showing the angled brackets
it’s not actually a freemarker thing, it’s that NetSuite has CHANGED the < to < etc in the stored value (I believe)
e
just a shot in the dark, sorry 😕
j
😞
LT!bGT!this is some bold textLT!/bGT! and this part is not bold
If I do: ${record.custbody_additional_clauses?replace(“<“,”LT!“)?replace(“>“,”GT!“)} I get this: LT!bGT!this is some bold textLT!/bGT! and this part is not bold
If I do: ${record.custbody_additional_clauses?replace(“<“,”<“)?replace(“>“,”>“)}
I get this:
message has been deleted
SOLVED THIS. Turns out because my actual HTML had new lines (to make it more readable) Freemarker threw a hissy fit. Take the newlines out and it’s all good.