Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Printing search results as a pdf using advanced html template
I think I am missing something as this code works without any errors, but the only thing the page contains is "render.TemplateRenderer". Any insight would be helpful
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
// This sample shows how to render search results into a PDF file.
define(['N/render', 'N/search', 'N/file'], function(render, search, file) {
function onRequest(options) {
var request = options.request;
var response = options.response;
var SOsearch = search.load({
id: '2277' //'customsearchitem_label_print' //the ID of the saved search
});
var resultSet = SOsearch.run();
var results = resultSet.getRange(0, 10);
//var results = SOsearch.getRange(0, 100);
//var xmlTemplateFile = file.load('Templates/PDF Templates/invoicePDFTemplate.xml'); //this will be the template file filepath