Skip to content

[Event Request] Table 81 "Gen. Journal Line" #29786

@aulon97

Description

@aulon97

Why do you need this change?

Why do you need this change?
Please add an event publisher before the standard TestField(Blocked, false) and TestField(Inactive, false) calls in the GetFAAccount & GetFABalAccount procedures of table 81 "Gen. Journal Line". The event should include an IsHandled flag so extensions can skip the standard blocked/inactive checks and implement custom logic , mirroring the extensibility already available in the GetFAAccount & GetFABalAccount procedures.

Alternatives Evaluated:
We have reviewed all existing events in table 81 . There is no event that allows us to conditionally bypass the standard Blocked/Inactive checks for specific business scenarios. Therefore, a new event at this location is required.

Justification for IsHandled:
We need to use IsHandled because, without it, the standard code would always execute the blocked/inactive checks, which may conflict with custom business processes or regulatory requirements. The IsHandled pattern is the only way to allow a subscriber to fully replace or bypass this logic. Without IsHandled, we would be forced to duplicate or override standard logic, which is not supported and would break on upgrades.

Performance Considerations:
This event is triggered only when field "Account No." or "Bal. Account No." are validated, and for "Account Type" is Fixed Asset. So there will not be frequently called. The additional event will not introduce any significant overhead.

Data Sensitivity Review:
The event parameters do not contain sensitive or confidential data. Exposing these is consistent with existing event signatures, and no additional data beyond what is already available in the production order line is required.

Multi-Extension Interaction:
Extensions that rely on this event must coordinate via dependency declarations. Partners can use EventSubscriberInstance = Manual to control execution order. The pattern is consistent with other core IsHandled events, so developers are familiar with the implications.

Example Custom Code:

local procedure GetFAAccount()
    var
        FA: Record "Fixed Asset";
    begin
        FA.Get("Account No.");
        //++++++++
        If Not CustMgt.CheckPostOnInactiveFA() then begin //Custom Code
        FA.TestField(Blocked, false);
        FA.TestField(Inactive, false);
        FA.TestField("Budgeted Asset", false);
        End; //Custom Code
        //---------
        UpdateDescription(FA.Description);
        GetFADeprBook("Account No.");
        GetFAVATSetup();
        GetFAAddCurrExchRate();

        OnAfterAccountNoOnValidateGetFAAccount(Rec, FA, CurrFieldNo);
    end;

    local procedure GetFABalAccount()
    var
        FA: Record "Fixed Asset";
    begin
        FA.Get("Bal. Account No.");
       //++++++++
        If Not CustMgt.CheckPostOnInactiveFA() then begin //Custom Code
        FA.TestField(Blocked, false);
        FA.TestField(Inactive, false);
        FA.TestField("Budgeted Asset", false);
        End; //Custom Code
        //---------
        UpdateDescriptionFromBalAccount(FA.Description);
        GetFADeprBook("Bal. Account No.");
        GetFAVATSetup();
        GetFAAddCurrExchRate();

        OnAfterAccountNoOnValidateGetFABalAccount(Rec, FA);
    end;

Describe the request

Requested event placement and usage:
1.Procedure GetFAAccount

local procedure GetFAAccount()
    var
        FA: Record "Fixed Asset";
        IsHandled : Boolean; //New Code
    begin
       IsHandled := false; //New Code
        FA.Get("Account No.");
       OnGetFAAccountOnBeforeFixedAssetTestField(Rec,FA,IsHandled); //New Event 
        If  not IsHandled then begin //New Code
        FA.TestField(Blocked, false);
        FA.TestField(Inactive, false);
        FA.TestField("Budgeted Asset", false);
        End; //New Code
        UpdateDescription(FA.Description);
        GetFADeprBook("Account No.");
        GetFAVATSetup();
        GetFAAddCurrExchRate();

        OnAfterAccountNoOnValidateGetFAAccount(Rec, FA, CurrFieldNo);
    end;

2.Procedure GetFABalAccount

    local procedure GetFABalAccount()
    var
        FA: Record "Fixed Asset";
        IsHandled : Boolean; //New Code
    begin
       IsHandled := false;         //New CodeFA.Get("Bal. Account No.");
         OnGetFABalAccountOnBeforeFixedAssetTestField(Rec,FA,IsHandled);//New Event
        If  not IsHandled then begin //New Code
        FA.TestField(Blocked, false);
        FA.TestField(Inactive, false);
        FA.TestField("Budgeted Asset", false);
        End; //New Code
        UpdateDescriptionFromBalAccount(FA.Description);
        GetFADeprBook("Bal. Account No.");
        GetFAVATSetup();
        GetFAAddCurrExchRate();

        OnAfterAccountNoOnValidateGetFABalAccount(Rec, FA);
    end;

Event signature:
1.Procedure GetFAAccount

 [IntegrationEvent(false, false)]
    local procedure OnGetFAAccountOnBeforeFixedAssetTestField(GenJournalLine: Record "Gen. Journal Line";var FixedAsset:  Record "Fixed Asset"; var IsHandled)
    begin
    end;

2.Procedure GetFABalAccount

 [IntegrationEvent(false, false)]
    local procedure OnGetFABalAccountOnBeforeFixedAssetTestField(GenJournalLine: Record "Gen. Journal Line";var FixedAsset:  Record "Fixed Asset"; var IsHandled)
    begin
    end;

Internal work item: AB#624113

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions