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

  • Suggested answer
    JAngle Profile Picture
    159 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 9 Super User 2026 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 1 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans