microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
781 stars 620 forks source link

[Event Request] table 81 "Gen. Journal Line" - OnBeforeCheckDirectPostingCheckGLAccount #25876

Closed RZ440 closed 8 months ago

RZ440 commented 8 months ago

Describe the request

Hello, can you please add a new event OnBeforeCheckDirectPostingCheckGLAccount to table 81 "Gen. Journal Line"?

    local procedure CheckGLAcc(GLAcc: Record "G/L Account")
    var
        IsHandled: Boolean;
    begin
        GLAcc.CheckGLAcc();
        IsHandled := false;
        OnBeforeCheckDirectPostingCheckGLAccount(Rec, GLAcc, IsHandled);
        If IsHandled then
            exit;
        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);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnBeforeCheckDirectPostingCheckGLAccount(var GenJournalLine: Record "Gen. Journal Line"; var GLAccount: Record "G/L Account"; var IsHandled: Boolean)
    begin
    end;

Additional context

Enable different GLAccChecks. We need access to the Rec and the event OnBeforeCheckDirectPosting doesn???t have access either.

Internal work item: AB#499108

azure-boards[bot] commented 8 months ago

✅ Successfully linked to Azure Boards work item(s):

AleksandricMarko commented 8 months ago

Hello @RZ440 As OnBeforeCheckDirectPosting event now has Rec as parameter, this request is not needed

image