Using N/render module and passing a record to xml file to edit pdf

Using ‘N/render’ module in the suitescript a record can be loaded in the suitescript and the record can be passed as a parameter to xml file which can be called inside the Xml file.

Sample code:

 var invoiceRecord = record.load({

                        type: record.Type.INVOICE,

                        id: recordId

                    });

 renderer.addRecord(‘record’, invoiceRecord);

var pdfFile = renderer.renderAsPdf();

The passed record can be called inside the xml file :

<p style=“font-family: Arial, Helvetica, sans-serif; font-size: 11px;”><strong>Tax Amount (In Words): ${record.taxAmountInWords}</strong></p>

Leave a comment

Your email address will not be published. Required fields are marked *