Skip to content

[Event Request] Codeunit 99000773 "Calculate Prod. Order" procedure TransferBOM - OnTransferBOMOnAfterProcessProdBOM #29984

@AlessandroLongoni

Description

@AlessandroLongoni

Why do you need this change?

Hi,

our customer needs a customization in order to change the standard behaviour while the system search for the active production BOM line using starting date and ending date fields in the "Production BOM Line" table.
We already subscribed the event publisher OnTransferBOMOnAfterSetFiltersProdBOMLine in order to change the "Starting Date" and "Ending Date" with a customization, but we need a new event to subscribe in scenarios with a Production BOM with lines with Type="Prod. BOM".

Describe the request

We need an event in this position to change the filters on the ProdBOMLine record because they are now changed back to the ProdOrderLine."Starting Date" and ProdOrderLine."Starting Date" values on the 2 lines right above the NEW EVENT.
If you can add the line with comment //NEW EVENT we can subscribe it with a customization

ProdBOMLine[Level].Type::"Production BOM":
begin
    OnTransferBOMOnBeforeProcessProdBOM(ProdBOMLine[Level], LineQtyPerUOM, ItemQtyPerUOM, ReqQty, ProdOrderLine);
    TransferBOM(ProdBOMLine[Level]."No.", Level + 1, ReqQty, 1);
    ProdBOMLine[Level].SetRange("Production BOM No.", ProdBOMNo);
    if Level > 1 then
        ProdBOMLine[Level].SetRange("Version Code", VersionMgt.GetBOMVersion(ProdBOMNo, ProdOrderLine."Starting Date", true))
    else
        ProdBOMLine[Level].SetRange("Version Code", ProdOrderLine."Production BOM Version Code");
    ProdBOMLine[Level].SetFilter("Starting Date", '%1|..%2', 0D, ProdOrderLine."Starting Date");
    ProdBOMLine[Level].SetFilter("Ending Date", '%1|%2..', 0D, ProdOrderLine."Starting Date");
    OnTransferBOMOnAfterProcessProdBOM(ProdBOMLine[Level], LineQtyPerUOM, ItemQtyPerUOM, ReqQty, ProdOrderLine);  //NEW EVENT
end;

and the integration event, where the ProdBOMLine parameter is "var"

[IntegrationEvent(false, false)]
local procedure OnTransferBOMOnAfterProcessProdBOM(var ProdBOMLine: Record "Production BOM Line"; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ReqQty: Decimal; ProdOrderLine: Record "Prod. Order Line")
begin
end;

Thank you and best regards,
Alessandro
Internal work item: AB#632876

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions