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.
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:
Here is my code (a codeunit to send the email and a report extension)