Skip to content

[W1][ReportExtension][7305][Mfg. WhseSourceCreateDocument] Add publisher after CalcFields("Pick Qty.") in Prod. Order Component - OnAfterGetRecord #30394

Description

@mavohra

Why do you need this change?

We derive a component's pick quantity differently from the standard "Pick Qty." FlowField for dual-UOM/catch-weight items, where the standard proportional rounding produces a value that disagrees with our own quantity tracking. Today there is no event between CalcFields("Pick Qty.") and the line that subtracts it (QtyToPick := "Expected Quantity" - "Qty. Picked" - "Pick Qty."), so we cannot substitute our own value before it is used. OnAfterGetRecordProdOrderComponent fires earlier in the same trigger, before the CalcFields call, so anything we set there is overwritten.

Describe the request

Add a publisher immediately after CalcFields("Pick Qty.") and before it is used in the QtyToPick calculation, so a subscriber can override the value that drives the pick quantity.

trigger OnAfterGetRecord()
begin
    ...
    WhseWkshLine.SetRange("Source Line No.", "Prod. Order Line No.");
    WhseWkshLine.SetRange("Source Subline No.", "Line No.");
    if not WhseWkshLine.FindFirst() then begin
        TestField("Qty. per Unit of Measure");
        CalcFields("Pick Qty.");
        OnAfterGetRecordProdOrderComponentOnAfterCalcFieldsPickQty("Prod. Order Component");

        QtyToPick := "Expected Quantity" - "Qty. Picked" - "Pick Qty.";
        ...

Event Signature:

[IntegrationEvent(false, false)]
local procedure OnAfterGetRecordProdOrderComponentOnAfterCalcFieldsPickQty(var ProdOrderComponent: Record "Prod. Order Component")
begin
end;

Alternatives evaluated:

  • Subscribing to OnAfterGetRecordProdOrderComponent (the existing skip-decision event): fires before CalcFields("Pick Qty."), so any value set there is overwritten by the CalcFields call that runs afterward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe issue misses information that prevents it from completion.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions