RE: How to render sales order and picking ticket advanced pdf from a custom button?

I have created suitelet script to render sales order advanced pdf. Now I want to combine the picking ticket on second page of sales order pdf. Sales order pdf template is sales order type and picking ticket pdf template  is ‘picking ticket’ type it could be possible? I will appreciate your help!


 * @NApiVersion 2.1
 * @NScriptType Suitelet
define([‘N/search’, ‘N/record’, ‘N/runtime’,’N/render’,’N/file’,’N/url’,’N/xml’],
function(search, record, runtime,render,file,url,xml)
  function onRequest(context) {
          var requestparam = context.request.parameters;
          var custom_id = requestparam.recId;
          //var custom_id=13187;
          var pdfFileName = “salesorder”;
          var renderer = render.create();
                  var content = renderer.addRecord({
                templateName: ‘record’,
                record: record.load({
                  type: record.Type.SALES_ORDER,
                  id: custom_id
            name: ‘content-disposition’,
            value: ‘inline; filename=”‘ + pdfFileName + ‘_’ + custom_id + ‘.pdf”‘
                              //resolve domain to get suitelet url
          var output = url.resolveDomain({
              hostType: url.HostType.APPLICATION,
          var pdfFileObj=renderer.renderAsPdf();
          pdfFileObj.folder = 1797;
 = “samplepdf”;
          pdfFileObj.isOnline = true;
          // log.debug(“bol”, bol);
          let fileid =;
           //loaded the pdf files
               let pdfFinal1 = file.load(fileid);
               output = “https://” + output + pdfFinal1.url;
       return {
Maira S Beginner Asked on January 5, 2024 in SuiteScript.
Add Comment
1 Answers

Create the button with SUE then have it call a function in the CUE to capture all the data and pass it to the suitelet to render the pdf

Rookie Answered on January 18, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.