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 99000769 "Production BOM-Check" - OnAfterGetProdBOMHeader #27021

Closed 1languste closed 3 weeks ago

1languste commented 1 month ago

Describe the request

I want to perform additional business logic after the ProdBOMHeader is retrieved. Therefore, I request the following event:

procedure CheckBOMStructure(BOMHeaderNo: Code[20]; VersionCode: Code[20]; Level: Integer)
var
    ProdBOMHeader: Record "Production BOM Header";
    ProdBOMComponent: Record "Production BOM Line";
begin
    if Level > 99 then
        Error(
            Text001,
            99, BOMHeaderNo, Item."Production BOM No.", Level);

    ProdBOMHeader.Get(BOMHeaderNo);
    // NEW BEGIN
    OnAfterGetProdBOMHeader(ProdBOMHeader, VersionCode, Item);
    // NEW END
    ProdBOMComponent.SetRange("Production BOM No.", BOMHeaderNo);
    ProdBOMComponent.SetRange("Version Code", VersionCode);
    ProdBOMComponent.SetFilter("No.", '<>%1', '');
    // ...
end;

[IntegrationEvent(false, false)]
local procedure OnAfterGetProdBOMHeader(ProdBOMHeader: Record "Production BOM Header"; VersionCode: Code[20]; Item: Record Item)
begin
end;

Additional context

I want to do additional checks on the Routing- and BOM-Lines. Internal work item: AB#544579

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.