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...
Suggested Answer

Workflows - approval of purchase invoices - forcing attachment

(0) ShareShare
ReportReport
Posted on by 15

When a purchase invoice has been entered, we send them off via "Request Approval/Send approval request" and a corresponding workflow built using the "Purchase Invoice Approval Workflow" template.

When we create the entry for the purchase invoice, we also attach the invoice in a PDF forrm.

Is it possible to block the approval request being sent without an attachment?

We have tried using the filters within the workflow such as "Attached Doc Count" and "Attached to line no" both in the "Purchase Line" filters under "On Condition" within the workflow for approving purchase invoices.

However, this has not been succesful.

I would be interested to know if this can be achieved either through a workflow or potentially some other option?

Many thanks.

Stephen

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    152 on at

    The “other option” would be development. An event subscriber like below would be a start in a codeunit

    [EventSubscriber(ObjectType::Codeunit, codeunit::"Release Purchase Document", 'OnBeforeManualReleasePurchaseDoc', '', false, false)]

    get it to run a function like this

    local procedure CheckPurchDocAttachments(var PurchHeader: record "Purchase Header")var DocAtt: Record "Document Attachment";

        PurchSetup: Record "Purchases & Payables Setup";

        NoDocumentAttachmentsErr: Label 'Purchase %1 must have at least one Document attached';

        begin

            DocAtt.Reset();

            DocAtt.SetRange("Table ID", 38);

            DocAtt.SetRange("Document Type", PurchHeader."Document Type");

            DocAtt.SetRange("No.", PurchHeader."No.");

            if not DocAtt.FindFirst then Error(NoDocumentAttachmentsErr, Format(PurchHeader."Document Type"));

        end;

     

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 March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,933 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,055 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 640 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans