I am trying to script a customer statement and sen...
# suitescript
s
I am trying to script a customer statement and send it via email. However, nothing comes on the statement when sent through email. It does appear correctly when I go to the customer and "generate statement". My code is below. Does there appear to be something wrong? I'm just trying to generate a customer statement
Copy code
attachments: [render.statement({
    entityId: Number(entityId),
    printMode: render.PrintMode.PDF,
    openTransactionsOnly:true,
})]
s
You need to set the startDate property in render.statement, otherwise I believe it defaults to today's date, which is not very useful.
👍🏼 1
s
Man, something is still wrong. The ui returns 2 invoices. the code returns empty
nvm. It helps to use the same customer lol