Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

BC24 Purchase Invoice approval workflow

Posted on by 4
BC24 how can we set up below?
 
Purchase Invoice with line type G/L account, has to go through the regular approval flow (same as a purchase order)
 
Purchase invoice where we use the functionality "get receipt lines" we don't want to go through the approval flow as the lines are coming from a PO which already went through the approval flow
 
 
Categories:
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 24,504 Super User 2024 Season 2 on at
    BC24 Purchase Invoice approval workflow
    Great! I'm happy to help!
     
  • MU-20110937-0 Profile Picture
    MU-20110937-0 4 on at
    BC24 Purchase Invoice approval workflow
    Dear Valentin,
     
    Thank you so much for taking the time to answer my question, much appreciated. I have configured it exactly as you described and it works perfectly. Once again, thank you so much for you assistance.
     
    Kind regards,
     
    Mirella
  • Verified answer
    Valentin Castravet Profile Picture
    Valentin Castravet 24,504 Super User 2024 Season 2 on at
    BC24 Purchase Invoice approval workflow
    You can configure and use the standard Purchase Invoice Approval workflow by adding one condition/filter.
     
    Set the workflow to activate only for purchase invoices where the purchase line includes a non-empty 'Receipt No.' field. The filter criteria should be set to <>''
     
    This will work out of the box without customization. Only lines added using the Get Receipt Lines function will have a non-empty 'Receipt No.' field. Lines manually added will have this field empty. 
     
     
     
  • Suggested answer
    Ramiz Profile Picture
    Ramiz 311 on at
    BC24 Purchase Invoice approval workflow
    Hi,

    You need an identifier to specify whether to run the approval flow or not.  You can create a boolean field on purchase header and control it with that.

     
    Get Receipt Lines has an event that you can subscribe to update the identifier.
     
    tableextension 50000 "Purchase Header RA" extends "Purchase Header"
    {
        fields
        {
            field(50000; "Need Approval"; Boolean)
            {
                Caption = 'Need Approval';
                InitValue = true;
                DataClassification = CustomerContent;
            }
        }
    }
    
    
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Get Receipt", OnAfterCreateInvLines, '', false, false)]
        local procedure OnAfterCreateInvLines(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")
        begin
            PurchaseHeader."Need Approval" := false;
            PurchaseHeader.Modify(false);
        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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,990 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,656 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans