ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 11729 "Cash Document-Post CZP" - procedure PostLines()

Open jlorenc01 opened this issue 3 years ago • 2 comments

Hi there,

I would like to ask for a new publisher in the codeunit 11729 "Cash Document-Post CZP", procedure PostLines(). We need to modify records in own tables after the each line is posted with use of "G/L Entry No.". The same subscriber is i.e. in standard codeunit 90 "Purch.-Post", in procedure PostInvoicePostBufferLine() in former implementation of posting, event is called OnAfterPostInvPostBuffer(). Or in new CU 826 "Purch. Post Invoice Events", event is called OnPostLinesOnAfterGenJnlLinePost(). Thank you.

codeunit 11729 "Cash Document-Post CZP"
{
...
    local procedure PostLines()
    var
        ...
    begin
        ...
        if CashDocumentLineCZP.FindSet() then
        repeat
            ....
            OnBeforePostCashDocLine(TempGenJournalLine, CashDocumentLineCZP, GenJnlPostLine);
            //GenJnlPostLine.RunWithCheck(TempGenJournalLine);
            GLEntryNo := GenJnlPostLine.RunWithCheck(TempGenJournalLine); // NEW, INSTEAD OF PREVIOUS LINE
            OnAfterPostCashDocLine(TempGenJournalLine, CashDocumentLineCZP, GLEntryNo, GenJnlPostLine); // NEW EVENT
        until CashDocumentLineCZP.Next() = 0;

    [IntegrationEvent(false, false)]
    local procedure OnAfterPostCashDocLine(var GenJournalLine: Record "Gen. Journal Line"; var CashDocumentLineCZP: Record "Cash Document Line CZP"; GLEntryNo: Integer; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
    begin
    end;
}

Standard CU 90 "Purch.-Post": (or similar in new CU 816 "Purch. Post Invoice")

codeunit 90 "Purch.-Post"
{
    ...
    local procedure PostInvoicePostBufferLine(PurchHeader: Record "Purchase Header"; InvoicePostBuffer: Record "Invoice Post. Buffer") GLEntryNo: Integer
    var
        GenJnlLine: Record "Gen. Journal Line";
    begin
        OnBeforePostInvoicePostBufferLine(PurchHeader, InvoicePostBuffer);
        with GenJnlLine do begin
            ...
            GLEntryNo := RunGenJnlPostLine(GenJnlLine);
            OnAfterPostInvPostBuffer(GenJnlLine, InvoicePostBuffer, PurchHeader, GLEntryNo, SuppressCommit, GenJnlPostLine);
        end;
    end;
}

jlorenc01 avatar Aug 15 '23 11:08 jlorenc01

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 11967.

JesperSchulz avatar Aug 25 '23 15:08 JesperSchulz

Availability update: We will publish a fix for this issue in the next update for release 22.

Build ID to track: 60034.

JesperSchulz avatar Aug 25 '23 15:08 JesperSchulz