Skip to content

[W1][ReportExtension][7305][Mfg. WhseSourceCreateDocument] Add publisher before SetCustomWhseSourceLine's grouping number in Prod. Order Component - OnAfterGetRecord #30395

Description

@mavohra

Why do you need this change?

Some of our customers want each production order line picked as its own warehouse activity line rather than all lines for an order grouped together. SetCustomWhseSourceLine is called with a hardcoded grouping number of 1 for every component, so it is currently impossible to influence how pick lines get grouped without replacing the whole call. There is no event before this call that exposes the grouping number for a subscriber to change.

Describe the request

Add a publisher immediately before CreatePick.SetCustomWhseSourceLine is called, with a var parameter for the grouping number, so a subscriber can change how pick lines for the same production order are grouped.

if QtyToPick > 0 then begin
    LineNo := 1;
    OnBeforeSetCustomWhseSourceLineOnBeforeSetLineNo("Prod. Order Component", LineNo);
    CreatePick.SetCustomWhseSourceLine(
        "Prod. Order Component", LineNo,
        Database::"Prod. Order Component", Status.AsInteger(), "Prod. Order No.", "Prod. Order Line No.", "Line No.");
    ...

Event Signature:

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

Alternatives evaluated:

  • Subscribing to OnAfterSetCustomWhseSourceLine on codeunit "Create Pick": fires after the grouping number is already copied into the codeunit's internal TempNo field, and the event does not expose that field, so nothing can change it there.

Internal work item: AB#645233

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