Hi All, I have a multiple select field {test_multi...
# advancedpdf
s
Hi All, I have a multiple select field {test_multi} on Sales Order, which i use in Advanced PDF to print. The values multi-selected prints as "AAA BB CCC DDD". I wanted to replace the blank space by comma (,). On using ${test_multi?string?replace(" ",",")}, i dont see any changes happening to the print PDF. And also observed that, while i try to use <#list test_multi as tm> ${tm}</#list>, It throws error saying => For "#list" list source: Expected a sequence or collection, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel) Can someone help me on this. Thanks in advance!
w
I believe the delimiter isn't a space. I think it is the char \u0005
s
@Watz I got an error on using ${test_multi?string?replace('\u0005',',')} error: Syntax error in template "template" in line 195, column 88: Lexical error: encountered "u" (117), after "\'\\".
w
try ${test_multi?js_string?replace('\u0005',',')}
might need to escape that '\' somehow
s
tried ${test_multi?js_string?replace('\u0005',',')} But still the same error.
w
try to only do ?js_string and look at the result. Do you even get \u0005?
s
i get AAA\nBB\nCCC\nDDD
w
ok, so then replace '\n' instead.