ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Table 81 'Gen. Journal Line' - OnBeforeCheckGLAcc event

Open polina-se opened this issue 1 year ago • 1 comments

Why do you need this change?

Dear Microsoft Team, I would like to request a change in the existing event OnBeforeCheckGLAcc of table 81, 'Gen. Journal Line'. In our solution, the G/L Account can be blocked at a different level, and we need to implement an alternative method to validate the G/L Account.

Describe the request

I would like to request the addition of the IsHandled parameter to the OnBeforeCheckGLAcc event. This variable will allow us to implement an alternative method to check the G/L Account. Please implement these changes in the BC25 version.

Event Code:

[IntegrationEvent(false, false)]
local procedure OnBeforeCheckGLAcc(ar GLAccount: Record "G/L Account"; var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean) // new parameter
begin
end;

Procedure Code:

local procedure CheckGLAcc(GLAcc: Record "G/L Account")
  var
    IsHandled: Boolean;
begin
  OnBeforeCheckGLAcc(GLAcc, Rec, IsHandled); // new parameter
  if IsHandled then // new
    exit; // new

    GLAcc.CheckGLAcc();
    if GLAcc."Direct Posting" or ("Journal Template Name" = '') or "System-Created Entry" then
        exit;
    if Rec."Posting Date" <> 0D then
        if "Posting Date" = ClosingDate("Posting Date") then
            exit;

    CheckDirectPosting(GLAcc);

    OnAfterCheckGLAcc(Rec, GLAcc);
end;

Internal work item: AB#597133

polina-se avatar Aug 11 '25 13:08 polina-se

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

JesperSchulz avatar Sep 10 '25 07:09 JesperSchulz