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 99000774 "Calculate Routing Line" - OnAfterSetCalendarEntryFiltersOnLoadCapBack #27022

Closed 1languste closed 3 weeks ago

1languste commented 1 month ago

Describe the request

I want to set additional calendar entry filters. Therefore, I request the following event:

local procedure LoadCapBack(CapType: Enum "Capacity Type"; CapNo: Code[20]; TimeType: Enum "Routing Time Type"; Write: Boolean)
begin
    OnBeforeLoadCapBack(ProdOrderRoutingLine, TimeType, RemainNeedQty, ProdEndingDate, ProdEndingTime);

    ProdOrderRoutingLine."Starting Date" := ProdEndingDate;
    ProdOrderRoutingLine."Starting Time" := ProdEndingTime;

    CalendarEntry.SetCapacityFilters(CapType, CapNo);
    CalendarEntry.SetRange("Ending Date-Time", 0DT, CreateDateTime(ProdEndingDate + 1, ProdEndingTime));
    CalendarEntry.SetRange("Starting Date-Time", 0DT, CreateDateTime(ProdEndingDate, ProdEndingTime));
    // NEW BEGIN
    OnAfterSetCalendarEntryFiltersOnLoadCapBack(CalendarEntry);
    // NEW END
    CreateLoadBack(TimeType, Write);

    if RemainNeedQty = 0 then
        exit;

    TestForError(Text001, Text002, ProdOrderRoutingLine."Starting Date");
end;

[IntegrationEvent(false, false)]
local procedure OnAfterSetCalendarEntryFiltersOnLoadCapBack(var CalendarEntry: Record "Calendar Entry")
begin
end;

Additional context

I want to filter the calendar entry for "Capacity (Effective)" <> 0. Internal work item: AB#544582

JesperSchulz commented 3 weeks ago

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 23210.