microsoft / ALAppExtensions

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

[Event Request] Codeunit 1901 "Report Selection Mgt." - OnBeforeInsertRepSelection #27015

Open 1languste opened 1 month ago

1languste commented 1 month ago

Describe the request

I would like to handle the report selection insert with my own business logic. Therefore, I request the following event:

local procedure InsertRepSelection(ReportUsage: Enum "Report Selection Usage"; Sequence: Code[10]; ReportID: Integer)
var
    ReportSelections: Record "Report Selections";
    // NEW BEGIN
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeInsertRepSelection(ReportUsage, Sequence, ReportID, IsHandled);
    if IsHandled then
        exit;
    // NEW END
    if not ReportSelections.Get(ReportUsage, Sequence) then begin
        ReportSelections.Init();
        ReportSelections.Usage := ReportUsage;
        ReportSelections.Sequence := Sequence;
        ReportSelections."Report ID" := ReportID;
        ReportSelections.Insert();
    end;
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertRepSelection(ReportUsage: Integer; Sequence: Code[10]; ReportID: Integer; var IsHandled: Boolean)
begin
end;

Additional context

When a Report Selection record is found, I want to modify the ReportID. Internal work item: AB#544381