web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Infinite recursive loop error in AL

(0) ShareShare
ReportReport
Posted on by 481

I am facing a recursive loop when I try to use Report.SaveAs() in a report extension. I understand that Report.SaveAs() runs the report again which is what causes the loop to occur.

My goal is to automatically email the report as a pdf to the associated customer after they run the report. How do I get past this if I can't call Report.SaveAs() OnPostReport? Where can I call Report.SaveAs() so that I can still send it to the same customer that ran the report?

Thanks,

I have the same question (0)
  • Suggested answer
    Brad_P Profile Picture
    1,549 on at
    RE: Infinite recursive loop error in AL

    Without knowing the specifics of the report - you can wrap the report in code that calls the "report for print" and the "report for saving." You can RunRequestPage to get the parameters for the report.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,085

#2
YUN ZHU Profile Picture

YUN ZHU 1,810 Super User 2025 Season 2

#3
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,788

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans