microsoft / ALAppExtensions

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

[Event Request] Codeunit 5996 "Prod. Order Warehouse Mgt." - OnBeforeGetMachineCenterBinCode #27018

Closed 1languste closed 2 months ago

1languste commented 2 months ago

Describe the request

I would like to handle the retrieval of the machine center bin code with my own business logic. Therefore, I request the following event:

local procedure GetMachineCenterBinCode(MachineCenterNo: Code[20]; LocationCode: Code[10]; UseFlushingMethod: Boolean; FlushingMethod: Enum "Flushing Method"): Code[20]
var
    MachineCenter: Record "Machine Center";
    // NEW BEGIN
    IsHandled: Boolean;
    Result: Boolean;
begin
    IsHandled := false;
    OnBeforeGetMachineCenterBinCode(MachineCenterNo, LocationCode, UseFlushingMethod, FlushingMethod, Result, IsHandled);
    if IsHandled then
        exit(Result);
    // NEW END
    if MachineCenter.Get(MachineCenterNo) then begin
        if MachineCenter."Location Code" = LocationCode then
            exit(MachineCenter.GetBinCodeForFlushingMethod(UseFlushingMethod, FlushingMethod));

        exit(GetWorkCenterBinCode(MachineCenter."Work Center No.", LocationCode, UseFlushingMethod, FlushingMethod));
    end;
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeGetMachineCenterBinCode(MachineCenterNo: Code[20]; LocationCode: Code[10]; UseFlushingMethod: Boolean; FlushingMethod: Enum "Flushing Method"; var Result: Code[20]; var IsHandled: Boolean)
begin
end;

Additional context

I want the flushing method bin code to be retrieved only if the machine center "From-Production Bin Code" field is filled. Internal work item: AB#544576

JesperSchulz commented 2 months 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.