How to reference joined column result for renderer.addSearchResults
I’m trying to reference:
new nlobjSearchColumn(“upccode”,”memberItem”,null),
…to my custom PDF template using:
var renderer = nlapiCreateTemplateRenderer();
renderer.addSearchResults(‘results’, results);
but I don’t know how. Normal result column value can be referenced using:
${result.mpn}
Can anyone point me to the right direction?
Thanks in advance.
Try printing all the keys of result
to find your answer:
<#list result?keys as k> ${k} </#list>
Thanks Eric but unfortunately it’s didn’t show any.
but doing this will show all the values so I’m not quite sure why using the ?keys didn’t work.
<#list result
as
r> ${r} </#list>
I cannot find a solution in a direct way but I solved in another way.
I didn’t add the fields as joined fields but as formulatext. The unique identifier after formulatext permits to access each field separately.
var filters= []; filters.push(new nlobjSearchFilter("internalid",null,"is", 40556971)); filters.push(new nlobjSearchFilter("accounttype",null,"anyof","@NONE@")); var columns=[]; column=new nlobjSearchColumn("formulatext_externalid"); column.setFormula("{item.externalid}"); columns.push(column); column=new nlobjSearchColumn("formulatext_color"); column.setFormula("{item.custitem_flb_santoni_colore}"); columns.push(column); column=new nlobjSearchColumn("formulatext_size"); column.setFormula("{item.custitem_flb_santoni_taglia}"); columns.push(column); columns.push(new nlobjSearchColumn("accounttype")); columns.push(new nlobjSearchColumn("quantity")); var searchresult = nlapiSearchRecord("transaction", null, filters, columns );