Create customer statement PDF for selected subsidiary with SuiteScript 2.0

Hi All,

 

I am trying to create PDF of customer statement for selected subsidiary using SuiteScript 2.0.
However it seems render.statement(options) does not have option for subsidiary.

 

[SuiteScript 1.0]
nlapiPrintRecord(type, id, mode, properties)
properties can include “subsidiary”

 

[SuiteScript 2.0]
render.statement(options)
there is no option for subsidiary

 

I found SuiteAnswer Id: 80239, but the example does not work.

Does anyone know how to select subsidiary for render.statement() ?

 

Thank you for your help in advance. 🙂

 

Rookie Asked on February 24, 2021 in SuiteScript.
Add Comment
1 Answer(s)

The code for render.statement looks like:

function renderStatement(options) {
 var printProperties = new Object();
 checkParameters(options);
 if (options.formId) {
  printProperties["formnumber"] = options.formId;
 }
 if (options.inCustLocale) {
  printProperties["incustlocale"] = options.inCustLocale;
 }
 if (options.openTransactionsOnly) {
  printProperties["openonly"] = options.openTransactionsOnly;
 }
 if (options.consolidateStatements) {
  printProperties["consolstatement"] = options.consolidateStatements;
 }
 if (options.statementDate) {
  printProperties["statementdate"] = options.statementDate;
 }
 if (options.startDate) {
  printProperties["start_date"] = options.startDate;
  printProperties["startdate"] = options.startDate;
 }
 var pdfFile = invoker(renderApi, "nlapiPrintRecord", [
  "STATEMENT",
  options.entityId,
  options.printMode || null,
  printProperties,
 ]);
 return Object.freeze(file.wrap(pdfFile));
}

There are no options for subsidiary. Theoretically you can probably monkey patch the Object constructor, but thats pretty desperate. Best option would probably be a support case.

Intermediate Answered on February 25, 2021.

Thanks battk!

I will create PDF generation part using SuiteScript 1.0.

on March 1, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor