web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Email Editor (13, Document) - Customise attachment behaviour

(2) ShareShare
ReportReport
Posted on by 911
 
Hi,
 
I'm trying to customise the attachment behaviour in page: Email Editor (13) and it's listpart page: Email Attachments (8889). Here's an example scenario:
 
Let's say I have a Posted Sales Invoice with an attachment PDF with a filename that matches a convention of SupportLog_*.PDF (e.g.) SupportLog_TestCompany1.PDF or SupportLog_TestCompany2.PDF etc... as below;
 
 
... and I select the email action, the Email Editor (13) page is displayed with the invoice auto-inserted in PDF format into the Attachments ListPart at the bottom (as below):
 
 
... The aforementioned attachment has been auto-inserted into the Email Related Attachment (8910) temporary table and can be manually added via the 'Add file from source document' action as below:
 
 
My quest is to make the page load with the extra attachment auto-inserted without having to click the 'Add file from source document' action, as below:
 
 
I've investigated subscribing to various events:
 
[EventSubscriber(ObjectType::Table, Database::"Email Item", OnBeforeSetAttachments, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::Email, OnGetAttachment, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::Email, OnFindRelatedAttachments, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::Email, OnBeforeGetEmailAttachmentsByEmailScenarios, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Document Attachment Mgmt", OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Document Attachment Mgmt", OnAfterSetDocumentAttachmentFiltersForRecRefInternal, '', false, false)]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Document Attachment Mgmt", OnAfterSetDocumentAttachmentFiltersForRecRef, '', false, false)]
[EventSubscriber(ObjectType::Table, Database::"Document Attachment", OnBeforeGetAsTempBlob, '', false, false)]
[EventSubscriber(ObjectType::Table, Database::"Document Attachment", OnBeforeGetContentType, '', false, false)]
 
... but can't see one that offers the hook I'm looking for. I'm trying to find one that offers a reference to temporary tables: Email Related Attachment (8910) and 
Email Message Attachment (8904). Also, when trying to access the Email Message Attachment table in AL code, I get the error below:
 
I'm guessing that's something to do with Access = Internal?
 
table 8904 "Email Message Attachment"
{
    Access = Internal;
    InherentPermissions = X;
    InherentEntitlements = X;
 
 
Any ideas which event I should hook into?
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at
    Hi, hope the following helps.
    Dynamics 365 Business Central: Automatically add default attachments in email sent (Email Editor) – Customization
     
    Thanks.
    ZHU
  • Nick Webb Profile Picture
    911 on at
    Many thanks, exactly what I was looking for.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans