ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 427 ICInboxOutboxMgt - OnBeforeModifyGenJnlLine (in function CreateJournalLines)

Open Mike-1984 opened this issue 4 years ago • 1 comments

Hello colleagues,

In codeunit 427 ICInboxOutboxMgt, in function CreateJournalLines there is an event OnBeforeInsertGenJnlLine, but the dimensions of the journal line are changed after this event, so we can't use it to control dimensions.

Please create new event OnBeforeModifyGenJnlLine in function CreateJournalLines

                "External Document No." := InboxJnlLine."Document No.";
                OnBeforeInsertGenJnlLine(GenJnlLine2, InboxJnlLine);
                Insert;
                InOutBoxJnlLineDim.SetRange("Table ID", DATABASE::"IC Inbox Jnl. Line");
                InOutBoxJnlLineDim.SetRange("Transaction No.", InboxTransaction."Transaction No.");
                InOutBoxJnlLineDim.SetRange("Line No.", InboxJnlLine."Line No.");
                InOutBoxJnlLineDim.SetRange("IC Partner Code", InboxTransaction."IC Partner Code");
                TempInOutBoxJnlLineDim.DeleteAll();
                DimMgt.CopyICJnlDimToICJnlDim(InOutBoxJnlLineDim, TempInOutBoxJnlLineDim);
                "Dimension Set ID" := DimMgt.CreateDimSetIDFromICJnlLineDim(TempInOutBoxJnlLineDim);
                DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code",
                  "Shortcut Dimension 2 Code");
                // ++++++++
                OnBeforeModifyGenJnlLine(GenJnlLine2, InboxJnlLine);
                // --------------
                Modify;
                HandledInboxJnlLine.TransferFields(InboxJnlLine);
                HandledInboxJnlLine.Insert();

Event signature:

     [IntegrationEvent(false, false)]
    local procedure OnBeforeModifyGenJnlLine(var GenJnlLine: Record "Gen. Journal Line"; ICInboxJnlLine: Record "IC Inbox Jnl. Line")

Mike-1984 avatar May 19 '22 15:05 Mike-1984

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: 40908.

JesperSchulz avatar May 22 '22 14:05 JesperSchulz