Discussions
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