Wednesday, April 24, 2019

Print transaction and download PDF using Suitelet

The following sample code can be used for creating PDF with picking ticketsof transaction specified by parameter id and followed by directdownload to the computer:

function downloadPDF(request, response) {    var id = request.getParameter("tranid");    var r = nlapiPrintRecord('PICKINGTICKET', id, 'PDF');    response.setContentType(r.getType(), 'transaction'+id+'.pdf', 'attachment');    response.write(r.getValue());}

No comments:

Post a Comment