Skip to content

[W1][Report][7305][Whse.-Source - Create Document] Add Integration Event OnAfterSplitPostedWhseRcptLine in CreatePutAwayFromDiffSource procedure #30144

@mavohra

Description

@mavohra

Why do you need this change?

After the base case block executes either SplitInternalPutAwayLine or SplitPostedWhseRcptLine, there is no event that allows subscribers to perform additional processing on TempPostedWhseReceiptLine. Container tracking requires a secondary split pass on TempPostedWhseReceiptLine specifically when SourceType = Database::"Posted Whse. Receipt Line" and container tracking is installed. Without an event at this point, this logic must be inserted directly into the base case, requiring a base modification on every upgrade.

Describe the request

Add OnAfterSplitPostedWhseRcptLine immediately after the case block ends, before RemQtyToHandleBase is assigned, so subscribers can perform additional operations on TempPostedWhseReceiptLine for any SourceType.

 procedure CreatePutAwayFromDiffSource(PostedWhseRcptLine: Record "Posted Whse. Receipt Line"; SourceType: Integer)
    var
        TempPostedWhseReceiptLine: Record "Posted Whse. Receipt Line" temporary;
        TempPostedWhseReceiptLine2: Record "Posted Whse. Receipt Line" temporary;
        ItemTrackingMgt: Codeunit "Item Tracking Management";
        RemQtyToHandleBase: Decimal;
        IsHandled: Boolean;
    begin
        case SourceType of
            Database::"Whse. Internal Put-away Line":
                ItemTrackingMgt.SplitInternalPutAwayLine(PostedWhseRcptLine, TempPostedWhseReceiptLine);
            Database::"Posted Whse. Receipt Line":
                ItemTrackingMgt.SplitPostedWhseRcptLine(PostedWhseRcptLine, TempPostedWhseReceiptLine);
        end;
         OnAfterSplitPostedWhseRcptLine(PostedWhseRcptLine, TempPostedWhseReceiptLine, SourceType); 
        RemQtyToHandleBase := PostedWhseRcptLine."Qty. (Base)";
        TempPostedWhseReceiptLine.Reset();
        .....
end;

Event Signature:

[IntegrationEvent(false, false)]
local procedure OnAfterSplitPostedWhseRcptLine(
    var PostedWhseRcptLine: Record "Posted Whse. Receipt Line";
    var TempPostedWhseReceiptLine: Record "Posted Whse. Receipt Line" temporary;
    SourceType: Integer)
begin
end;

Alternatives evaluated:
Inserting the container split directly into the Database::"Posted Whse. Receipt Line" of the base case requires a base modification on every upgrade, causes merge conflicts, and violates the AL extensibility rules. No event currently exists after the case block that exposes both TempPostedWhseReceiptLine and SourceType together, leaving direct base modification as the only available option without this change.
Internal work item: AB#638506

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions