Render statement subsidiary parameter not working

This is my code

var statementOpts = {
                entityId: 987,
                printMode: render.PrintMode.PDF,
                openTransactionsOnly: true,
                startDate: “01/01/2023”,
                statementDate: “24/09/2023”,
                subsidiaryId : 23
            }
render.statement(statementOpts)

 

According to NS documentation it should work, but in my case it keeps generating the statement for the main subsidiary and not the one set.

Rookie Asked on September 24, 2023 in SuiteScript.
Add Comment
7 Answer(s)

Hi All,

The solution to make the subsidiary to work is to create a custom form and make sure the Printing radio button is set on Advance. After that the parameter worked. So you need a custom form, by default it wont work.

Rookie Answered on September 26, 2023.
Add Comment

Hi,

I’ve got almost identical code and it’s working as expected.

Is the customer definitely associated with this subsidiary?

Thanks,

Chris

Advanced Answered on September 25, 2023.

Hi,

Yes the customer is associated with the subsidiary, the subsidiary can be selected when generating an individual statement with the GUI and works, but when you try the code, it just generates the statement of the main subsidiary and not the one you pass as parameter.

Thanks,

David

on September 25, 2023.
Add Comment

Hi,

Yes the customer is associated with the subsidiary, the subsidiary can be selected when generating an individual statement with the GUI and works, but when you try the code, it just generates the statement of the main subsidiary and not the one you pass as parameter.

Thanks,

David.

Rookie Answered on September 25, 2023.
Add Comment

So is it showing transactions from other subsidiaries?

How / where is the script running and under what role?

Advanced Answered on September 25, 2023.

Yes,

The transactions from all subsidiaries are displayed on the customer. And when generating the statement with the GUI all is correct.
The code si running on a suitelet as an administrator.

Thanks,
David

on September 25, 2023.
Add Comment

Yes all transactions are show on the customer. The statement is correctly created with the GUI, the subsidiary filter works.
But when I tries the same on suitescript is does not, que script is a suitelet that si ran as administrator.

Thanks,
David

Rookie Answered on September 25, 2023.
Add Comment

Good spot! Glad you’ve got it working.

Advanced Answered on September 27, 2023.
Add Comment

Hi Sigehelm,

I am a newbie for this. I have some question and problem like you.

Where did you use your code? Could you share to me?

And Do this code run via API? If it’s true, please give me URL

Thanks!

Rookie Answered on November 21, 2023.
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   SuiteMigration   Become a Sponsor