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." - OnBeforeInsertRepSelectionWhse #27016

Open 1languste opened 1 month ago

1languste commented 1 month ago

Describe the request

I would like to handle the Whse. Report Selection insert with my own business logic. Therefore, I request the following event:

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

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

Additional context

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

AndersLarsenMicrosoft commented 2 weeks ago

Please reach out to mee on andersla@microsoft.com

AndersLarsenMicrosoft commented 1 week ago

please disregard my comment above - sorry