Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Adding more than one search result to nlobjTemplateRenderer
Has anyone been able to successfully add two different search results to nlobjTemplateRenderer using two different variable names? Whenever I try to do this, it just get a blank output. I know it's not a template or freemarker issue, because if I add either one of the searches individually, the output is just fine.
Basically, this is what I'm trying to accomplish -
//saved search results from two searches are stored in variables sResults1 and sResults2 var rend = nlapiCreateTemplateRenderer(); var templateFile = var templateFile = nlapiLoadFile(templateFileId); var templateString = templateFile.getValue(); rend.setTemplate(templateString); rend.addRecord('record', oppRec); <span style="color:'#0000FF'">rend.addSearchResults('<strong>resultsa</strong>', <strong>sResults1</strong>); rend.addSearchResults('<strong>resultsb</strong>', <strong>sResults2</strong>);</span> //adding two search results like this produces a blank output 0