Hello, I'm trying to use SuiteScript 1.0, specific...
# suitescript
m
Hello, I'm trying to use SuiteScript 1.0, specifically the
nlapiPrintRecord
method to print a customer's statement (id 1023) for a specific subsidiary. I've followed the documentation, however the specified subsidiary gets ignored every time. Here's the relevant part:
Copy code
var sdate = new Array();

      sdate.startdate = '01/01/2023';
      sdate.openonly = 'T';
      sdate.subsidiary = 3;

      //Prints an empty array
      nlapiLogExecution('DEBUG', 'Array: ', JSON.stringify(sdate));

      // Try to print the statement using nlapiPrintRecord method
      var stFile = nlapiPrintRecord('STATEMENT', 1023, 'PDF', sdate);
b
dont use an Array as an Object
m
Yeah, that part confused me too but I went with it because I got it from the documentation. I've also tried already using an object instead of an array but didn't work.
b
you can try making a support case with netsuite, but i would expect that to require being able to reproduce the issue in suitescript 2
m
Got it, thank you as always @battk!