Good morning :slightly_smiling_face:, What's the ...
# suitescript
n
Good morning 🙂, What's the most effective method to display a saved search results as a list on a xml += table(suitelet to pdf) ? I'm currently using the search module to pull the results. but im having challenges with displaying the lines with the loop, im missing something.
Copy code
var search = search.load({
     id: 'somesearch123' 
   });

   var searcResults = search.run().getRange(0, 100);
    for (var i = 0; i < search.length; i++) {
      var item = searcResults[i].getValue({
        line: i,
        name: 'item'
      });
      var quantity = searcResults[i].getValue({
        line: i,
        name: 'quantity'
      });
      var date = searcResults[i].getValue({
        line: i,
        name: 'unit'
      });
    };

    //xml += '<#list' + searcResults + ' as item>';
    xml += '<tr>';
    xml += '<td>' + item '</td>';
    xml += '<td>' + quantity + '</td>';
    xml += '<td>' + date + '</td>';
    xml += '</tr>';
    //xml += '</#list>';