Skip to content

[W1][Table][232][Gen. Journal Batch] OnBeforeOnDelete event #29127

Description

@polina-se

Why do you need this change?

Dear Microsoft Team,
I would like to request the addition of a new event, OnBeforeOnDelete, in table 232 'Gen. Journal Batch'.
This event is required to add conditions for deleting Lines (GenJnlAlloc and GenJnlLine).
Specifically, to prevent deleting GenJnlAllocated and GenJnl lines for the GenJnlBatch that is used in the Payment Registration and our custom setup.
Thank you for considering this request.

Describe the request

This change is needed in BC25.
Proposed Event Code:

[W1][Table][232][Gen. Journal Batch] OnBeforeOnDelete()
___
This event is necessary to prevent deleting GenJnlAllocated and GenJnl lines for the GenJnlBatch used in Payment Registration and our custom setup.
___
[IntegrationEvent(false, false)]local procedure OnBeforeOnDelete(var GenJournalBatch: Record "Gen. Journal Batch"; var GenJnlAlloc: Record "Gen. Jnl. Allocation"; var GenJnlLine: Record "Gen. Journal Line"; GenJnlTemplate: Record "Gen. Journal Template"; var IsHandled: Boolean)
begin
end;

Proposed Event Placement:

trigger OnDelete()
var
begin
    IsHandled := false;
    OnBeforeOnDelete(Rec, GenJnlAlloc, GenJnlLine, GenJnlTemplate, IsHandled);
    if IsHandled then
       exit;
    
    ApprovalsMgmt.PreventDeletingRecordWithOpenApprovalEntry(Rec);
    ...
end;

Internal work item: AB#599976

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions