Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

Can't send email using AL due to filtering error

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
    YUN ZHU 70,333 Super User 2024 Season 2 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
    JAngle 33,157 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
    jdrco 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
    JAngle 33,157 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,572 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,764 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans