Notifications
Announcements
No record found.
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.
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.
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
Where do you call the report ? Do you call it from a page ? If yes, put it there.
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?
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.
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
Is there a way to have that OnAction trigger on a button from the report's request page?
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.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 2,606
YUN ZHU 931 Super User 2025 Season 2
Jainam M. Kothari 773 Super User 2025 Season 2