I need to use the render.statement function per su...
# suitescript
j
I need to use the render.statement function per subsidiary but no property. Am I missing something?
var pdfStatement = render.statement({
entityId: parseInt(row.id),
printMode: render.PrintMode.PDF,
statementDate: stDate,
inCustLocale: true,
});
Any workarounds....?
c
Is it doable in the UI?
j
Yes
b
the code for render.statement is
Copy code
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.subsidiaryId && util.isNumber(options.subsidiaryId)) {
    printProperties["subsidiary"] = options.subsidiaryId;
  }
  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));
}
👍 2