Robert Vice
09/25/2023, 8:18 PMlet startDate = new Date();
And it never seems to work. I've also tried to use format.format and format.parse on the variable above without success.
I either get a message bout options.startDate must be a string or an "unexpected error"
If I remove both dates, then it's happy.CD
09/25/2023, 8:23 PMRobert Vice
09/25/2023, 8:27 PMconst dateStatement = new Date();
const startDateDate = new Date();
// Set start date to 11 days prior
startDateDate.setDate(startDateDate.getDate() - 11);
const startDate = format.format({
value: startDateDate,
type: format.Type.DATETIME
});
const statementDate = format.format({
value: dateStatement,
type: format.Type.DATETIME
});
const attachment = render.statement({
entityId: 1,
printMode: render.PrintMode.PDF,
startDate: startDate,
statementDate: statementDate,
openTransactionsOnly: true,
subsidiaryId: 1,
inCustLocale: true
});
Well, your Q helped sove it.
Was my format type, changing it to format.Type.DATE resolved it