Chapter 03: Email Attachments

3.1 Attachment Overview

Email attachments enhance notifications by providing recipients with documents, reports, or files they need to review, process, or keep for their records. The Advanced Email App supports two fundamentally different types of attachments, each serving distinct purposes and configured in different ways. Understanding when to use each type and how they work ensures you create email notifications that provide recipients with the right information in the right format at the right time.

Types of Attachments

Fixed File Attachments are static documents that you upload once during template configuration and that attach to every email sent using that template. These attachments remain unchanged regardless of what data triggered the email or what placeholders resolve to in the email content. Fixed attachments are appropriate when you need to include standard documents like company policies, terms and conditions, instruction manuals, marketing materials, or any other file that recipients need but that doesn't vary based on the specific transaction or record that triggered the email.

For example, if you create an email notification that welcomes new customers, you might attach a fixed PDF file containing your company's customer handbook, return policy, or getting-started guide. Every customer who triggers that welcome email receives exactly the same attachment. The content of the attachment doesn't need to be personalized or generated dynamically because it's general information applicable to all customers.

Report Attachments are dynamic documents that Business Central generates at the moment the email sends, using current data from the record that triggered the email. These attachments vary for each email based on the specific transaction, customer, order, or other record involved. Report attachments are appropriate when you need to include personalized or transaction-specific documents like order confirmations, invoices, shipment notices, statements, or any other report that should reflect the actual data that triggered the notification.

For example, if you create an email notification that sends when a sales order is created, you might attach a report-based order confirmation document. When the email sends, Business Central runs the order confirmation report for that specific order, generates a PDF containing that order's details, and attaches it to the email. Each customer receives an attachment showing their specific order information.

When to Use Each Type

Use Fixed File Attachments When:

  • The attachment content is the same for all recipients

  • The attachment contains reference information, policies, or general documentation

  • You create the document outside Business Central (Word, PDF, etc.)

  • The document doesn't need to reflect current Business Central data

  • You want to ensure recipients receive exactly the file you uploaded

Use Report Attachments When:

  • The attachment should contain data specific to the triggering record

  • You need to include transaction details, customer information, or calculated values

  • You want Business Central to generate the attachment from configured reports

  • The attachment format should be consistent but content should vary per instance

  • You need to dynamically filter reports using placeholder values from the triggering record

Attachment Limitations

The Advanced Email App, like Business Central's email system generally, has practical limitations on attachments that you should be aware of:

File Size Considerations - While Business Central can technically handle large attachments, email infrastructure outside Business Central often imposes size limits. Many email servers reject messages with attachments exceeding 10-25 MB. If your reports or fixed files are large, consider whether you need to include all information, reduce image quality, or provide links to documents stored elsewhere instead of attaching them directly.

Email Deliverability - Some email systems and spam filters become more aggressive with messages containing attachments, particularly executable files or large documents. Test email delivery thoroughly when using attachments, especially to external recipients.

Performance Impact - Generating report attachments requires Business Central to execute the report, which consumes system resources. If you configure email notifications that fire frequently (hundreds or thousands of times per day) with complex report attachments, monitor system performance to ensure the email generation workload doesn't impact other Business Central operations.

πŸ“‹ NOTE: The number of attachments per email is not strictly limited by the Advanced Email App, but practical email system limitations typically make it inadvisable to attach more than 3-5 files to a single email. If you need to provide recipients with many documents, consider creating a summary email with a link to a document repository or shared folder instead of attaching all documents directly.

3.2 Adding Fixed File Attachments

Fixed file attachments allow you to include standard documents that don't vary between email instances. This section explains how to upload files and configure them as attachments to your email templates.

Uploading Files

To add a fixed file attachment:

  1. Open the email template to which you want to add an attachment (either create a new email or edit an existing one).

  2. Locate the Attachments section on the Email card page. This is typically in the middle portion of the page, below the email body editor and above the triggers section.

  3. Click in the first empty row in the attachments list to add a new attachment.

  4. In the Type field, select or enter Fixed. This indicates that this attachment is a file you will upload rather than a dynamically generated report.

  5. In the File Name field, enter the name you want the attachment to have in the email. Include the file extension (e.g., "Customer_Handbook.pdf" or "Terms_and_Conditions.docx"). This filename appears to recipients when they view the email.

  6. Click in the Attachment field. This triggers the upload dialog.

  7. In the file selection dialog that appears, navigate to the location where your file is stored on your computer or network.

  8. Select the file you want to attach and click Open or OK (button name varies by browser and operating system).

  9. Business Central uploads the file and stores it in the attachment record. The Attachment field changes to show Yes or displays a checkmark, indicating the file has been uploaded successfully.

  10. Click away from the attachment row to save it, or continue adding more attachments if needed.

πŸ“‹ NOTE: When you upload a file, Business Central stores the entire file content in the database as part of the attachment record. This means the file is embedded in your Business Central environment and will be available even if you later delete the original file from your computer. However, it also means that very large files consume database storage, so be mindful of attachment sizes.

Supported File Types

Business Central's email system supports attachments of virtually any file type. Common file types used in business communications include:

Documents:

  • PDF (.pdf) - Recommended for most document attachments as PDFs preserve formatting and are universally readable

  • Microsoft Word (.docx, .doc) - Useful when recipients need to edit the document

  • Microsoft Excel (.xlsx, .xls) - Useful for templates, forms, or data that recipients will work with

  • Text files (.txt) - For simple text content without formatting

Images:

  • JPEG (.jpg, .jpeg) - For photographs or complex images

  • PNG (.png) - For diagrams, screenshots, or images requiring transparency

  • GIF (.gif) - For simple graphics or diagrams

Other Formats:

  • ZIP archives (.zip) - For sending multiple files in a single attachment

  • XML (.xml) - For data exchange or structured content

  • HTML (.html) - For formatted content viewable in web browsers

⚠️ WARNING: Some file types (particularly executable files like .exe, .bat, .com, .scr) are commonly blocked by email security systems because they can potentially contain malware. Avoid using executable file attachments. If you absolutely must send software or tools, consider using a secure file sharing service and including a link in the email instead of attaching the file directly.

File Size Considerations

While Business Central itself doesn't impose strict limits on attachment sizes (within database constraints), email infrastructure commonly imposes practical limitations:

Email Server Limits - Many email servers limit message sizes to 10-25 MB total, including the email content and all attachments. If your attachment approaches or exceeds these sizes, delivery failures may occur.

Recipient Email System Limits - Even if your email server sends large attachments successfully, recipients' email systems may reject them. This is particularly common with external recipients (customers, vendors) whose email systems you don't control.

Network and Performance - Sending large attachments impacts network bandwidth and email system performance. If you configure email notifications that fire frequently with large attachments, the cumulative impact can be significant.

Best Practices for File Sizes:

  • Keep individual attachments under 5 MB when possible

  • If documents exceed 5 MB, consider compressing them (PDF compression, image quality reduction, ZIP archives)

  • For documents exceeding 10 MB, strongly consider alternative delivery methods like SharePoint, OneDrive, or other file sharing services

  • Test email delivery with large attachments to external recipients before deploying in production

πŸ’‘ TIP: If you need to include large PDF documents, many PDF tools offer compression options that significantly reduce file size with minimal quality loss. Similarly, reducing image resolution or converting color images to grayscale can substantially reduce document sizes without making them unreadable.

Managing Fixed Attachments

Once uploaded, fixed attachments can be managed through the attachments list:

Viewing Attachment Details:

  • The File Name column shows the name recipients will see

  • The Attachment column indicates whether a file has been uploaded (Yes/No or checkmark)

  • The Type column shows this is a Fixed attachment

Replacing an Attachment: To replace an existing fixed attachment with a different file:

  1. Click on the attachment row

  2. Click in the Attachment field to trigger the upload dialog

  3. Select a different file

  4. The new file replaces the previous file

Removing an Attachment: To remove an attachment from the template entirely:

  1. Select the attachment row

  2. Press Delete or use the delete function in your interface

  3. The attachment is removed and will no longer be included in emails

πŸ“‹ NOTE: Modifying or removing attachments from an email template affects only future emails. Emails that have already been sent retain the attachments that were included when they were sent. You cannot retroactively change attachments on emails that have already been delivered.

3.3 Adding Report Attachments

Report attachments provide dynamic, data-driven documents that Business Central generates specifically for each email. This capability allows you to include personalized order confirmations, invoices, statements, or other reports that reflect the actual data triggering the email notification.

Selecting Reports

Business Central includes hundreds of standard reports covering all functional areas (sales, purchasing, inventory, finance, etc.). Additionally, many organizations create custom reports specific to their business requirements. Any Business Central report that you can run interactively can potentially be attached to an email notification.

To add a report attachment:

  1. Open the email template to which you want to add a report attachment.

  2. In the Attachments section, click in an empty row to add a new attachment.

  3. In the Type field, select Report. This indicates that this attachment will be a dynamically generated report rather than a fixed file.

  4. In the Report Id field, enter the numeric ID of the report you want to attach. For example, "1305" is the standard sales order confirmation report in many Business Central versions.

Finding Report IDs:

Report IDs are numeric identifiers that Business Central assigns to each report. Finding the correct report ID can be challenging if you're not familiar with Business Central's internal numbering:

Using Object Search - If your Business Central version provides object search functionality, search for reports by name and note the ID number.

Consulting Documentation - Your Business Central implementation documentation or your partner's documentation may include a list of commonly used report IDs.

Asking Your Administrator - System administrators or Business Central consultants familiar with your environment can quickly identify report IDs for standard reports.

Trial and Error - You can enter a report ID, configure the attachment, and test it to see if it produces the desired output. This approach works when you have a rough idea of the report ID range.

Common Standard Report IDs:

Report ID

Report Name

Description

1305

Sales Order Confirmation

Order details for customer

205

Sales Invoice

Printed sales invoice

206

Sales Shipment

Shipment notification document

405

Purchase Order

Purchase order to vendor

406

Purchase Receipt

Goods receipt document

101

Customer List

List of customers

301

Vendor List

List of vendors

720

Inventory Valuation

Inventory value report

πŸ“‹ NOTE: Report IDs vary between Business Central versions, localizations, and custom implementations. The IDs listed above are examples from common Business Central versions but may differ in your specific environment. Always verify report IDs in your environment before configuring report attachments.

Configuring Report Parameters

Business Central reports often have parameters and filters that control what data appears in the report output. When configuring a report attachment, you need to specify these parameters so the report generates appropriate output.

To configure report parameters:

  1. After entering the Report Id, enter a File Name for the output file (e.g., "Order_Confirmation.pdf"). Include the appropriate file extension based on the report format you'll select.

  2. In the Report Format field, select the output format:

    • Pdf - Most common; creates portable, formatted documents

    • Excel - Useful for data that recipients need to analyze or manipulate

    • Word - Useful when recipients need to edit the content

    • Html - Web-format document viewable in browsers

    • Xml - Data exchange format

  3. Click the drill-down action (typically clicking on "No" in the Attachment column or clicking the three-dot menu). This opens the report's request page where you must configure filters and options.

  4. On the report request page that appears, you will see:

    • Options section - Report-specific settings like whether to show amounts, which language to use, number of copies, etc.

    • Filter: [Table Name] section(s) - This is where you define which records the report should include

  5. Configure Dynamic Filters Using Placeholders - This is the critical step:

    • In the filter fields (e.g., "No.", "Document Type", "Customer No."), enter placeholder syntax to dynamically filter based on the triggering record

    • For example, to filter a Sales Order report to show only the order that triggered the email, enter [36:3] in the "No." filter field (where 36 is Sales Header table and 3 is the No. field)

    • You can use any placeholder that references fields from the trigger table or linked tables

    • Multiple filter fields can be configured with different placeholders

  6. Configure additional filter conditions as needed using standard Business Central filter syntax combined with placeholders.

  7. Click OK on the request page. Business Central saves your filter and parameter configuration as XML in the attachment record.

  8. The Attachment field changes to Yes or shows a checkmark, indicating parameters have been configured.

⚠️ CRITICAL WARNING: There is NO automatic filtering of report attachments. If you do not configure filters using placeholders in the report request page, the report will run completely unfiltered and attach a document containing ALL records from the report's source table. For example, an unfiltered sales order report would include every order in the system, not just the one that triggered the email. Always configure filters using placeholders to ensure reports show only relevant data.

Understanding Dynamic Filtering with Placeholders:

The power of report attachments comes from using placeholder syntax in the filter fields of the report request page. When the email triggers, these placeholders are replaced with actual values from the triggering record, creating a dynamic filter specific to that instance.

βœ… EXAMPLE: Sales Order Confirmation Filter

For a sales order confirmation email triggered when orders are created:

  1. Report ID: 1305 (Sales Order report)

  2. Open the Attachment drill-down to access the report request page

  3. In the Filter: Sales Header section (or Filter: Sales Order depending on BC version):

    • Document Type field: Enter Order (static filter for order documents only)

    • No. field: Enter [36:3] (placeholder for Sales Header No.)

  4. Click OK

When the email sends for order SO-10001, the placeholder [36:3] is replaced with "SO-10001", so the report generates showing only that specific order. Without this filter configuration, the report would include every sales order in the database.

Common Filter Configurations:

Scenario

Report Table

Filter Field

Placeholder Value

Description

Sales Order

Sales Header (36)

No.

[36:3]

Filter to specific order number

Sales Invoice

Sales Invoice Header (112)

No.

[112:3]

Filter to specific invoice

Customer Statement

Customer (18)

No.

[18:1]

Filter to specific customer

Purchase Order

Purchase Header (38)

No.

[38:3]

Filter to specific purchase order

Item Report

Item (27)

No.

[27:1]

Filter to specific item

Multiple Filter Fields:

You can configure multiple filter fields to create more specific filtering:

Filter: Sales Header
  Document Type: [36:1]         (uses the document type from the triggering record)
  No.: [36:3]                   (uses the document number from the triggering record)
  Sell-to Customer No.: [36:2]

This ensures the report is precisely filtered to the exact record that triggered the email.

Choosing Output Formats

The Report Format field determines what type of file Business Central generates for the attachment. Each format has advantages and appropriate use cases:

PDF (Portable Document Format):

  • Advantages: Preserves exact formatting, universally readable, cannot be easily modified, professional appearance

  • Best For: Customer-facing documents, invoices, confirmations, formal communications

  • File Size: Moderate (usually 100KB - 2MB for typical business reports)

  • Recommended: Default choice for most business documents

Excel (Microsoft Excel Format):

  • Advantages: Recipients can sort, filter, and analyze data; formulas remain functional; easy to import into other systems

  • Best For: Data-heavy reports, lists, statements, analytical reports

  • File Size: Varies widely depending on data volume

  • Consideration: Formatting may not be as precise as PDF; requires Excel or compatible software to open

Word (Microsoft Word Format):

  • Advantages: Recipients can edit content, add comments, repurpose text

  • Best For: Templates, draft documents, collaborative editing scenarios

  • File Size: Moderate

  • Consideration: Less common for automated reports; formatting can shift between Word versions

HTML (Web Format):

  • Advantages: Viewable in any web browser, no special software required, supports hyperlinks well

  • Best For: Internal notifications, web-based workflows

  • File Size: Small

  • Consideration: Formatting can vary between browsers; less professional appearance than PDF

XML (Extensible Markup Language):

  • Advantages: Machine-readable structured data, integrates with other systems

  • Best For: System-to-system integration, data exchange, automated processing

  • File Size: Small to moderate

  • Consideration: Not human-readable; requires systems/tools to process

πŸ’‘ TIP: For customer-facing communications, PDF is almost always the best choice. It ensures that recipients see exactly what you intend, with proper formatting, logos, and layout, regardless of what software or device they use to view the attachment. Use Excel for reports where recipients need to work with the data, and use XML for automated system integrations.

Testing Report Attachments

Testing report attachments thoroughly before deploying email notifications in production is critical because report configuration errors may not be immediately obvious:

To test a report attachment:

  1. Complete the email template configuration including the report attachment.

  2. Create or identify a test record that will trigger the email (e.g., create a test sales order if testing an order confirmation email).

  3. Perform the action that triggers the email (e.g., create the test order).

  4. Check your email inbox for the notification.

  5. Open the email and verify:

    • The attachment is present

    • The attachment opens correctly

    • The attachment contains data for the correct record (the one that triggered the email, not other records)

    • All expected fields and values appear correctly

    • Formatting is appropriate

    • The file size is reasonable

  6. If the attachment is missing, opens with errors, contains wrong data, or has other problems, check:

    • Report ID is correct and the report is accessible

    • Report Format is specified

    • Report parameters were configured (Attachment field shows Yes)

    • The Validation Log for error messages about report generation

Common Report Attachment Issues:

Attachment contains all records instead of just the triggering record:

  • Most Common Cause: No filters were configured in the report request page

  • Solution: Open the attachment configuration, drill down to the report request page, and configure filter fields using placeholder syntax (e.g., [36:3] for Sales Header No.)

  • Always verify filters are saved by checking that the Attachment field shows "Yes" after configuring

Attachment is blank or shows no data:

  • Placeholder in filter field is not resolving to a valid value (check placeholder syntax)

  • Filter configuration is too restrictive and excludes the triggering record

  • Record that triggered email may not yet be committed to database at trigger timing (use After triggers instead of Before triggers)

Attachment shows wrong data:

  • Report filtering is not working correctly

  • Report ID refers to different report than intended

  • Report includes data from multiple records instead of just the triggering record

Attachment generation errors:

  • Report ID doesn't exist or isn't accessible to the user account sending emails

  • Report has required parameters that weren't configured

  • Report has errors in its design or dataset

3.4 Advanced Attachment Scenarios

Once you understand basic attachment configuration, you can implement more sophisticated scenarios that provide recipients with exactly the information they need in the most useful format.

Multiple Attachments per Email

Email templates support multiple attachments, allowing you to include several fixed files, several reports, or a combination of both in a single email notification.

To add multiple attachments:

  1. Configure the first attachment as described in previous sections.

  2. Click in the next empty row in the attachments list.

  3. Configure the second attachment (can be either Fixed or Report type).

  4. Repeat for additional attachments.

Each attachment you configure is included when the email sends. The order of attachments in the list determines the order they appear to recipients (though email clients vary in how they display multiple attachments).

βœ… EXAMPLE: Order Confirmation with Multiple Documents

Business Scenario: When sales orders are created, send customers an order confirmation report along with your standard terms and conditions and a return policy document.

Configuration:

Attachment 1:
  Type: Report
  Report Id: 1305 (Sales Order Confirmation)
  File Name: Order_[36:3]

When the email sends, recipients receive three attachments: their specific order confirmation plus the two standard policy documents.

πŸ“‹ NOTE: While Business Central doesn't impose a specific limit on attachment count, practical email system limitations and user experience considerations suggest limiting emails to 3-5 attachments. Beyond that, consider whether all attachments are truly necessary, or whether some could be provided via links to document libraries instead.

Dynamic File Names

The File Name field for both fixed and report attachments supports placeholders, allowing attachment filenames to include data values from the triggering record. This creates more organized, identifiable attachment files for recipients.

Static filename:

All emails use the same filename, making it harder for recipients to distinguish between multiple order confirmations in their download folders.

Dynamic filename with placeholders:

File Name: Order_[36:3]

If order SO-001 triggers the email, the attachment filename becomes "Order_SO-001_Confirmation.pdf". If order SO-002 triggers it, the filename becomes "Order_SO-002_Confirmation.pdf".

More complex dynamic filenames:

File Name: Invoice_[112:3]_Customer_[18:2]

Creates filenames like "Invoice_INV-001_Customer_Contoso.pdf" that include both invoice number and customer name.

πŸ’‘ TIP: When using placeholders in filenames, be aware that some characters that might appear in Business Central data (like slashes, backslashes, colons, question marks) are not valid in filenames. Business Central typically handles this by replacing invalid characters with underscores or removing them, but test your filename patterns to ensure they produce valid results.

Placeholder Usage in Filenames

The same placeholder syntax used in email subjects and bodies ([TableID:FieldID]) works in attachment filenames. This allows you to create meaningful, unique filenames that help recipients organize downloaded attachments.

Best practices for dynamic filenames:

Include Identifying Information First:

βœ… GOOD: [36:3]_Order_Confirmation.pdf
❌ POOR: Order_Confirmation_[36:3]

When recipients sort downloaded files by name, having the identifier first groups related documents together.

Keep Filenames Reasonably Short:

βœ… GOOD: Inv_[112:3]_[18:2].pdf
❌ POOR: Invoice_Number_[112:3]_for_Customer_[18:2]_generated_[TODAY]

Very long filenames can cause display and handling issues in some systems.

Use Underscores for Readability:

βœ… GOOD: Order_[36:3]_Amount_[36:61].pdf
❌ POOR: Order[36:3]Amount[36:61]

Underscores or hyphens between components make filenames easier to read.

Avoid Special Characters: Don't use characters like /, , :, *, ?, ", <, >, | in filenames as these have special meanings in file systems and will cause errors.

Best Practices for Attachments

Choose Appropriate Attachment Types:

  • Use Fixed attachments for documents that never change (policies, terms, instructions)

  • Use Report attachments for data that should reflect the current transaction

  • Don't use Fixed attachments when data should be personalized - recipients will notice receiving generic documents in situations where they expect personalized content

Optimize File Sizes:

  • Compress PDFs to reduce size while maintaining readability

  • Choose appropriate image resolution for fixed files - high resolution for print documents, lower resolution for screen viewing

  • Test download times, especially for recipients with slower internet connections

Test Thoroughly:

  • Test with various data scenarios to ensure reports generate correctly

  • Test sending to external email addresses to verify delivery

  • Have colleagues review attachment content for clarity and completeness

  • Verify attachments open correctly on different devices and email clients

Consider Recipient Needs:

  • Think about how recipients will use attachments - is PDF best for their needs, or would Excel be more useful?

  • Consider whether recipients need to edit, print, archive, or forward attachments

  • Balance comprehensive information against overwhelming recipients with too many attachments

Monitor Performance:

  • If emails with large attachments or complex reports send frequently, monitor Business Central performance

  • Consider scheduling less urgent emails to send during off-peak hours

  • Review Validation Log periodically for attachment generation errors

Security Considerations:

  • Be mindful of what data appears in attachments - ensure recipients should have access to that information

  • Verify that report filtering works correctly so recipients only see data they should see

  • Consider whether sensitive attachments should use encryption or password protection (external to Business Central)

Get Your FREE Dynamics 365 Demo

Transform your business operations with Microsoft Dynamics 365 Business Central

Experience the transformative power of Microsoft Dynamics 365 Business Central for yourself! Request a free demo today and see how our solutions can streamline your operations and drive growth for your business.

Our team will guide you through a personalized demonstration tailored to your specific needs. This draft provides a structured approach to presenting Qualia Tech's offerings related to Microsoft Dynamics 365 Business Central while ensuring that potential customers understand the value proposition clearly.

Areas Of Interest

Please read and confirm the following:

*Note: Fields marked with * are mandatory for processing your request.

*Note: Fields marked with * are mandatory for processing your request.

Β© 2024 Qualia. All rights reserved

QUALIA Technik GmbH

info@qualiatechnik.de

17, Heinrich-Erpenbach-Str. 50999 KΓΆln

Β© 2024 Qualia. All rights reserved

QUALIA Technik GmbH

info@qualiatechnik.de

17, Heinrich-Erpenbach-Str. 50999 KΓΆln

Β© 2024 Qualia. All rights reserved

QUALIA Technik GmbH

info@qualiatechnik.de

17, Heinrich-Erpenbach-Str. 50999 KΓΆln

Β© 2024 Qualia. All rights reserved

QUALIA Technik GmbH

info@qualiatechnik.de

17, Heinrich-Erpenbach-Str. 50999 KΓΆln