Skip to main content

Notifications

Community site session details

Community site session details

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

Can't send email using AL due to filtering error

(0) ShareShare
ReportReport
Posted on by 479

I am trying to send an email with a report as an attachment through AL when the report is run (Report 329 - Vendor trial balance). I am having trouble when I try to save the same report that was ran. This is the error I get when running the report (it prevents BC from sending the email too): It was not possible to find a Starting Date in Accounting Period.

pastedimage1657035267776v6.png

I believe the error stems from when I try to get a record with the same Vendor No. and Date filter as specified from the report request page:

pastedimage1657035321748v7.png

Here is my code (a codeunit to send the email and a report extension)

pastedimage1657034911271v5.png

pastedimage1657034597358v3.png

  • Verified answer
    YUN ZHU Profile Picture
    81,217 Super User 2025 Season 1 on at
    RE: Can't send email using AL due to filtering error

    Hi, as Josh mentioned, please check the Accounting Period settings.

    pastedimage1657073336951v1.png

    pastedimage1657073371722v2.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    JAngle Profile Picture
    83 on at
    RE: Can't send email using AL due to filtering error

    In the app. Follow this: docs.microsoft.com/.../finance-accounting-periods-and-fiscal-years

  • jdrco Profile Picture
    479 on at
    RE: Can't send email using AL due to filtering error

    JAngle How do I setup accounting periods? Do I do this through code?

  • Suggested answer
    JAngle Profile Picture
    83 on at
    RE: Can't send email using AL due to filtering error

    Have you reviewed the code of the report? Do you actually have accounting periods setup? I’d check those things first as the code has no immediate concerns

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,017 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,852 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans