ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Change Request] Codeunit 5632 - FA Jnl.-Post Line - OnBeforeGenJnlPostLine

Open Codey42 opened this issue 4 years ago • 1 comments

Dear ALAppExtensions team,

Through this issue we would like to request extending event publisher OnBeforeGenJnlPostLine in Codeunit 5632 FA Jnl.-Post Line to the following signature:

[IntegrationEvent(false, false)]
local procedure OnBeforeGenJnlPostLine(var GenJournalLine: Record "Gen. Journal Line";
                                       var FAInsertLedgerEntry: Codeunit "FA Insert Ledger Entry";
                                       FAAmount: Decimal;
                                       VATAmount: Decimal;
                                       NextTransactionNo: Integer;
                                       NextGLEntryNo: Integer;
                                       GLRegisterNo: Integer;
                                       var IsHandled: Boolean)
begin
end;

with VAR parameters GenJournalLine and FAInsertLedgerEntry (latter is required due to the methods FindFirstGLAcc and GetNextGLAcc). which would be called as follows from GenJnlPostLine:

procedure GenJnlPostLine(GenJnlLine: Record "Gen. Journal Line"; FAAmount: Decimal; VATAmount: Decimal; NextTransactionNo: Integer; NextGLEntryNo: Integer; GLRegisterNo: Integer)
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeGenJnlPostLine(GenJnlLine, FAInsertLedgEntry, FAAmount, VATAmount, NextTransactionNo, NextGLEntryNo, GLRegisterNo, IsHandled);
    if IsHandled then
        exit;

    FAInsertLedgEntry.SetGLRegisterNo(GLRegisterNo);
    FAInsertLedgEntry.DeleteAllGLAcc;
    with GenJnlLine do begin
        if "Account No." = '' then
            exit;
        if "FA Posting Date" = 0D then
            "FA Posting Date" := "Posting Date";
        IF "Journal Template Name" = '' THEN
          Quantity := 0;
        DuplicateDeprBook.DuplicateGenJnlLine(GenJnlLine, FAAmount);

Codey42 avatar Feb 03 '22 11:02 Codey42

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.

JesperSchulz avatar Feb 09 '22 07:02 JesperSchulz