NickSO
NickSO

Reputation: 103

Email Body for a custom report in Business Central

I have created a custom (.RDL) report in SQL Server Report Builder and an AL extension that emails this report as a PDF attachment from an action on a custom page & table in Business Central. This is working fine. My question is about the email body text. At the moment I have hardcoded a few sentences (e.g.) 'Please see attached document etc...' in the codeunit in the extension. Ideally I would like the users to be able to edit the email body text as and when needed in BC without me having to change the extension. Is there a way that an email body can be saved in Business Central for user editing? And can that email body be loaded programmatically by a codeunit prior to sending the email?

Upvotes: 0

Views: 1327

Answers (1)

kaspermoerch
kaspermoerch

Reputation: 16560

It is possible to do what you are asking using.

Business Central does exactly this when e.g. sending Sales Invoices.

You should have a look at the Report Selections table. It has a procedure GetEmailBodyTextForCust which does the swap to the relevant report layout for the email body. It is used in the procedure SendEmailToCustDirectly.

Note that the report layout used for email body must be a Word layout.

Upvotes: 0

Related Questions