Skip to main content
Business Central forum
Suggested answer

Email Body for a custom report in Business Central

editSubscribe (0) ShareShare
ReportReport
Posted on by 614

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?

Categories:
  • Suggested answer
    MahGah Profile Picture
    MahGah 15,395 on at
    RE: Email Body for a custom report in Business Central

    Hi

    I believe Steven provided a guideline for your question. 

    As he mentioned you only can use Word Report. But editing word layout also require extra work for users. We had a similar need but for different purposes (SO confirmation related). What we did is we created a new page in BC and then defined Code / Description. Then in email page we let user to select a code. Then in report we used description of code. This way user can go to new page and define new code with needed description which will be populated to report if code selected. In addition, we added the Code to SO if we want to use batch email. 

  • Suggested answer
    Steven Renders Profile Picture
    Steven Renders 4,929 Super User on at
    RE: Email Body for a custom report in Business Central

    To my knowledge only WORD layouts can be used in the email body, RDLC layouts are not supported. (Why I have no idea...)

    Set up email in Business Central (contains video) - Business Central | Microsoft Docs

    Technically there are several ways to 'change' behavior and customize what needs to happen:

    ALAppExtensions/Modules/System/Email at main · microsoft/ALAppExtensions · GitHub

    ALAppExtensions/Modules/System/Word Templates at main · microsoft/ALAppExtensions · GitHub

    ALAppExtensions/Other/EmailAddressLookupDemo at main · microsoft/ALAppExtensions · GitHub

    Issues · microsoft/ALAppExtensions · GitHub

    and you might also want to checkout these objects:

    Table 2118 O365 Email Setup
    Table 2170 O365 Default Email Message
    Table 5935 Service Email Queue
    Table 9500 Email Item
    Table 9501 Email Attachment
    Table 9510 Email Parameter
    Page 1805 Email Setup Wizard
    Page 1811 Setup Email Logging
    Page 2126 O365 Email CC Listpart
    Page 2127 O365 Email BCC Listpart
    Page 2128 O365 Email CC and BCC Settings
    Page 2135 O365 Email Account Settings
    Page 2149 O365 Email CC/BCC Card
    Page 2150 O365 Sales Email Dialog
    Page 2159 O365 Email Preview
    Page 2170 O365 Default Invoice Email Msg
    Page 2171 O365 Default Quote Email Msg
    Page 2197 O365 Email Setup Wizard
    Page 2328 BC O365 Email Settings Part
    Page 2329 BC O365 Email Settings
    Page 2335 BC O365 Email Account Settings
    Page 2370 BC O365 Default Email Messages
    Page 2397 BC O365 Email Setup Wizard
    Page 2823 Native - Email Preview
    Page 2842 Native - Email Setting
    Page 5961 Service Email Queue
    Page 9700 Email Dialog
    Report 1320 Notification Email
    Report 5084 Email Merge
    Report 6006 Delete Service Email Queue
    Codeunit 89 Sales-Post + Email
    Codeunit 1641 Setup Email Logging
    Codeunit 1655 Office Add-In Sample Emails
    Codeunit 2129 O365 Export Invoices + Email
    Codeunit 2135 O365 Setup Email
    Codeunit 2151 O365 Sales Email Management
    Codeunit 2380 O365 Email Customer Data
    Codeunit 5064 Email Logging Dispatcher
    Codeunit 5065 Email Logging Context Adapter
    Codeunit 5915 Customer-Notify by Email
    Codeunit 5917 Process Service Email Queue
    Codeunit 8891 Email Scenario Mapping
    Codeunit 8895 Email Feature
    Codeunit 8898 Map Email Source
    Enum 9510 Email Parameter Type
    EnumExtension 8891 Base Email Scenario

  • Nick Webb Profile Picture
    Nick Webb 614 on at
    RE: Email Body for a custom report in Business Central

    Thanks for your response. Interesting info about: Codeunit ‘SMTP Mail’ is marked for removal.

    However, neither link answers my questions below:-

    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?

  • Suggested answer
    MahGah Profile Picture
    MahGah 15,395 on at
    RE: Email Body for a custom report in Business Central

    Hi

    I hope the following post help

    https://yzhums.com/7485/

    https://yzhums.com/1799/

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans