microsoft / microsoft/BCApps

[Event Request][E-Document] Add publisher to "E-Document Mailing"

Open
#8,566 5 comments 0 reactions 1 assignee View on GitHub

@Groenbech96 is already working on this.

Since Jul 9, 2026.

Approved BCIdea event-request Team: Integrations
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

BC Idea Link

https://github.com/microsoft/ALAppExtensions/issues/30234

Description

In Codeunit 6188 "E-Document Emailing"

Allow update through publisher on the statement if the TempBlobList is set as attachments separately or as .zip archive.
In our case, we would like to create a .zip archive based on the document sending profile instead of the number of TempBlobs.

We would like to implement these changes

New Publisher

 [IntegrationEvent(false, false)]
    local procedure OnBeforeCreateAttachmentsBlob(
        var TempBlobList: Codeunit "Temp Blob List";
        var ExtensionList: List of [Text];
        DocumentSendingProfile: Record "Document Sending Profile";
        ReportUsage: Enum "Report Selection Usage";
        RecordVariant: Variant;
        DocNo: Code[20];
        DocName: Text[150];
        ToCust: Code[20];
        var AttachmentFileName: Text[250];
        var AttachmentFileExtension: Text;
        var TempBlob: Codeunit "Temp Blob";
        var IsHandled: Boolean)
    begin
    end;

Code placement

local procedure CreateAttachmentsBlob(
        DocumentSendingProfile: Record "Document Sending Profile";
        ReportUsage: Enum "Report Selection Usage";
        RecordVariant: Variant;
        DocNo: Code[20];
        DocName: Text[150];
        ToCust: Code[20];
        var AttachmentFileName: Text[250];
        var AttachmentFileExtension: Text): Codeunit "Temp Blob"
    var
        DataCompression: Codeunit "Data Compression";
        TempBlob: Codeunit "Temp Blob";
        IsHandled: Boolean; // new line
    begin
        OnBeforeCreateAttachmentsBlob(GlobalTempBlobList, GlobalExtensionList, DocumentSendingProfile, ReportUsage, RecordVariant, DocNo, DocName, ToCust, AttachmentFileName, AttachmentFileExtension, TempBlob, IsHandled); // new line
        If IsHandled then // new line
            exit(TempBlob); // new line

        if GlobalTempBlobList.IsEmpty() then
            exit(TempBlob);

        AttachmentFileName := CreateAttachmentName(DocNo, DocName);
        if (GlobalTempBlobList.Count() = 1) and (DocumentSendingProfile."E-Mail Attachment" = Enum::"Document Sending Profile Attachment Type"::"E-Document")
        then begin
            GlobalTempBlobList.Get(1, TempBlob);
            AttachmentFileExtension := GlobalExtensionList.Get(1);
        end else begin
            CreateZipArchiveWithEDocAttachments(DataCompression, GlobalTempBlobList, AttachmentFileName);

            if DocumentSendingProfile."E-Mail Attachment" = Enum::"Document Sending Profile Attachment Type"::"PDF & E-Document" then
                AddPdfAttachmentToZipArchive(DataCompression, ReportUsage, RecordVariant, ToCust, AttachmentFileName);

            DataCompression.SaveZipArchive(TempBlob);
            DataCompression.CloseZipArchive();
            AttachmentFileExtension := ZipFileTypeTok;
        end;
        exit(TempBlob);
    end;
I will provide the implementation for this BC Idea
  • I will provide the implementation for this BC Idea

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.