ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 90 "Purch.-Post" - OnPostInvoiceOnBeforePostVendorEntry

Open ReneZiel opened this issue 3 years ago • 2 comments

Hello, can you please add a new Event OnPostInvoiceOnBeforePostVendorEntry in codeunit 90 "Purch.-Post" ?

            // Check External Document number
            if PurchSetup."Ext. Doc. No. Mandatory" or (GenJnlLineExtDocNo <> '') then
                CheckExternalDocumentNumber(VendLedgEntry, PurchHeader);

            // Post vendor entries
            if GuiAllowed and not HideProgressWindow then
                Window.Update(4, 1);

            IsHandled := false;
            OnPostInvoiceOnBeforePostVendorEntry(PurchHeader, TotalPurchLine, GenJnlPostLine, TotalPurchLineLCY, SuppressCommit, VendLedgEntry, IsHandled);
            if IsHandled then
                exit;
    [IntegrationEvent(false, false)]
    local procedure OnPostInvoiceOnBeforePostVendorEntry(PurchHeader: Record "Purchase Header"; TotalPurchLine: Record "Purchase Line"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; TotalPurchLineLCY: Record "Purchase Line"; CommitIsSupressed: Boolean; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)
    begin
    end;

ReneZiel avatar May 10 '23 11:05 ReneZiel

No, this procedure is obsoleted and already have this event for the same purpose

    IsHandled := false;
    OnPostVendorEntryOnBeforeInitNewLine(PurchHeader, TotalPurchLine, TotalPurchLineLCY, GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, GenJnlPostLine, IsHandled);
    if IsHandled then
        exit;

AlexanderYakunin avatar Jun 06 '23 12:06 AlexanderYakunin

We still need this event (Issue #23317), because we want, in some specific cases, to skip posting some documents in PostInvoice procedure. The naming of the event was confusing for Microsoft, that is why they suggested to use another event, which is not useful at all 😊 Unfortunately is difficult to find a more meaningful name in that specific place. How do you think we should proceed? Renaming the event and creating a new request, or explaining them?

ReneZiel avatar Jun 08 '23 14:06 ReneZiel