Skip to main content

Notifications

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 479

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,

  • 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,217 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,976 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans