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:


Can anyone point me to the right direction?

Thanks in advance.

Rookie Asked on February 16, 2020 in SuiteScript.
Add Comment
2 Answer(s)

Try printing all the keys of result to find your answer:

<#list result?keys as k> ${k} </#list>

Beginner Answered on February 16, 2020.

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>  

on February 16, 2020.
Add Comment

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=new nlobjSearchColumn("formulatext_color");
column=new nlobjSearchColumn("formulatext_size");
columns.push(new nlobjSearchColumn("accounttype"));
columns.push(new nlobjSearchColumn("quantity"));
var searchresult = nlapiSearchRecord("transaction", null, filters, columns );

Rookie Answered on June 10, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor