ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Change Event] Codeunit 12 "Gen. Jnl.-Post Line".OnBeforeInitGLEntry

Open Softstore opened this issue 5 years ago • 1 comments

Change the parameter GLAccNo to allow change the G/L Account during the process. If the GLAccNo was passed by reference allow us the use the standard code instead make changes in the Event OnAfterInitGLEntry and repeat all the process again.

procedure InitGLEntry(GenJnlLine: Record "Gen. Journal Line"; var GLEntry: Record "G/L Entry"; GLAccNo: Code[20]; Amount: Decimal; AmountAddCurr: Decimal; UseAmountAddCurr: Boolean; SystemCreatedEntry: Boolean)

var GLAcc: Record "G/L Account"; begin OnBeforeInitGLEntry(GenJnlLine, GLAccNo, SystemCreatedEntry);   if GLAccNo <> '' then begin GLAcc.Get(GLAccNo); GLAcc.TestField(Blocked, false); GLAcc.TestField("Account Type", GLAcc."Account Type"::Posting);   // Check the Value Posting field on the G/L Account if it is not checked already in Codeunit 11 if (not ((GLAccNo = GenJnlLine."Account No.") and (GenJnlLine."Account Type" = GenJnlLine."Account Type"::"G/L Account")) or ((GLAccNo = GenJnlLine."Bal. Account No.") and (GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::"G/L Account"))) and not FADimAlreadyChecked then CheckGLAccDimError(GenJnlLine, GLAccNo); end;   GLEntry.Init(); GLEntry.CopyFromGenJnlLine(GenJnlLine); GLEntry."Entry No." := NextEntryNo; GLEntry."Transaction No." := NextTransactionNo; GLEntry."G/L Account No." := GLAccNo; GLEntry."System-Created Entry" := SystemCreatedEntry;     [IntegrationEvent(false, false)] local procedure OnBeforeInitGLEntry(var GenJournalLine: Record "Gen. Journal Line";  var GLAccNo: Code[20]; SystemCreatedEntry: Boolean) begin end;

Softstore avatar Feb 25 '21 22:02 Softstore

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. We will update this issue with information about availability. 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 Mar 24 '21 06:03 JesperSchulz