Friday, March 15, 2019

Print Transactions using Dynamic Templates

When printing transactions in the User Interface, NetSuite follows the PDF or HTML template that is set on the custom form.  To verify the default PDF/HTML template the transaction uses when printed, go to Setup > Customization > Transaction Forms.

In SuiteScript, nlapiPrintRecord can dynamically select which template to use when printing transactions by passing formnumber in the properties parameter:

     var pdf = nlapiPrintRecord('TRANSACTION', transactionId, 'PDF', {formnumber : templateId});
     nlapiSendEmail(-5,
jeff.a@nodomain.com, 'Transaction Summary', emailBody, null, null, null, pdf);

No comments:

Post a Comment