The object has been run. Use the function CLEAR(Report).
Where am I supposed to call that clear function?
I am trying to email a report as a pdf as soon as it is run.
The object has been run. Use the function CLEAR(Report).
Where am I supposed to call that clear function?
I am trying to email a report as a pdf as soon as it is run.
If you insist of sending pdf everytime user run the report, what you can do is to create a new table and insert the record to that table everytime user print the report.
A job queue will run regularly to check that table and send a pdf accordingly.
Or you can go back and ask the question whether it is necessary to do it that way.
As far as I know, there is no way. Because general actions cannot be added to the request page.
More details: https://yzhums.com/21114/
You can only do what Teddy said, create an action to the normal page.
Hope this help as well.
Thanks.
ZHU
Is there a way to have that OnAction trigger on a button from the report's request page?
Hi, Teddy is right, I have tested this before and got the same error as you.
So I think you should change your solution, for example, you can do this on the OnAction trigger (after or before) of the page button.
Hope this can give you some inspiration.
Thanks.
ZHU
There is no way you can do that from inside the report.
What you should do is create an action on the page. When user click the page, fill in the parameter for the report, run saveas and send the email.
You cannot preview/print the report and send itself at the same time.
TeddyH I just want to automatically email a report to a customer after they run the report. That is why I wanted to call it in the report object itself. Is this even possible?
Where do you call the report ? Do you call it from a page ? If yes, put it there.
TeddyH Where would I call the codeunit? Is there an event for when the report is run outside of the report extension object? I am facing recursion issues if I call the codeunit in the same report still
I don't think you can put the SaveAs logic inside the report.
When you use SaveAs, BC will run the report once and save the result in PDF.
If you put the SaveAs logic inside the report, it will basically go into loop.
Put the whole email logic inside codeunit and run it.
Sohail Ahmed
2,655
Mansi Soni
1,574
YUN ZHU
1,453
Super User 2025 Season 1