Notifications
Announcements
No record found.
Dear community members,
I tried to search the forums for a sample of using X++ to call a D365 Finance & Operations report and then email it, but can't seem to find a good place to start.
Basically I am trying to use code to call vendor payment advice report and email it to a vendor email address.
thank you all for reading and helping!
Fen
Here is an example:
SrsReportRunController controller = new SrsReportRunController(); controller.parmReportName(ssrsReportStr(SysUserRoleInfo, Report)); controller.parmShowDialog(false); SRSPrintDestinationSettings settings = controller.parmReportContract().parmPrintSettings(); settings.printMediumType(SRSPrintMediumType::Email); settings.fileFormat(SRSReportFileFormat::PDF); settings.fileName('SysUserRoleInfo.pdf'); // Here we configure the email SrsReportEMailDataContract emailContract = new SrsReportEMailDataContract(); emailContract.parmTo("user@example.com"); emailContract.parmSubject("Security report"); emailContract.parmBody("Hi there! Here is your report."); settings.parmEMailContract(emailContract); controller.startOperation();
Hi Fen,
You don't need to use X++ for that but can make use of the business reports and electronic reporting. There are build in standard features to send them automatically out by email.
Best regards,
Ludwig
Hi Martin,
I'm using the code that you show like example and works fine from a job (only for test); but when I use a web service it doesn't due to the default email to send.
how can I set a "from email address"?
Thanks for your help!
Hi Camilo, please never describe your problem by mere "it doesn't work", because there is no universal solution for all possible problem. We need to know what happens in your particular case.
What did you find when you debugged your web service?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 677 Super User 2025 Season 2
André Arnaud de Cal... 442 Super User 2025 Season 2
Martin Dráb 339 Most Valuable Professional