diff --git a/Apps/W1/EDocument/app/src/Processing/EDocAttachmentProcessor.Codeunit.al b/Apps/W1/EDocument/app/src/Processing/EDocAttachmentProcessor.Codeunit.al index a595457ce..64364397a 100644 --- a/Apps/W1/EDocument/app/src/Processing/EDocAttachmentProcessor.Codeunit.al +++ b/Apps/W1/EDocument/app/src/Processing/EDocAttachmentProcessor.Codeunit.al @@ -141,6 +141,21 @@ codeunit 6169 "E-Doc. Attachment Processor" end; end; + [EventSubscriber(ObjectType::Page, Page::"Doc. Attachment List FactBox", OnBeforeDocumentAttachmentDetailsRunModal, '', false, false)] + local procedure FilterEDocumentAttachmentsOnBeforeDocumentAttachmentDetailsRunModal(var DocumentAttachment: Record "Document Attachment"; var DocumentAttachmentDetails: Page "Document Attachment Details") + var + EDocumentEntryNo: Integer; + EDocumentEntryNoText: Text; + begin + DocumentAttachment.FilterGroup(4); + EDocumentEntryNoText := DocumentAttachment.GetFilter("E-Document Entry No."); + if EDocumentEntryNoText <> '' then begin + Evaluate(EDocumentEntryNo, EDocumentEntryNoText); + DocumentAttachmentDetails.FilterForEDocuments(EDocumentEntryNo); + end; + DocumentAttachment.FilterGroup(0); + end; + var MissingEDocumentTypeErr: Label 'E-Document type %1 is not supported for attachments', Comment = '%1 - E-Document document type'; diff --git a/Apps/W1/EDocument/app/src/Processing/EDocDocumentAttachmentDetails.PageExt.al b/Apps/W1/EDocument/app/src/Processing/EDocDocumentAttachmentDetails.PageExt.al new file mode 100644 index 000000000..dd1c95de8 --- /dev/null +++ b/Apps/W1/EDocument/app/src/Processing/EDocDocumentAttachmentDetails.PageExt.al @@ -0,0 +1,11 @@ +namespace Microsoft.eServices.EDocument; +using Microsoft.Foundation.Attachment; + +pageextension 6102 EDocDocumentAttachmentDetails extends "Document Attachment Details" +{ + internal procedure FilterForEDocuments(EDocumentEntryNo: Integer) + begin + Rec.SetRange("E-Document Attachment", true); + Rec.SetRange("E-Document Entry No.", EDocumentEntryNo); + end; +}