Skip to content

[Event Request] table 5767 "Warehouse Activity Line" - CopyItemTrackingToRelatedLine 🙏 #28916

@ghost

Description

Why do you need this change?

I need to skip the standard logic and implement my own logic.

The problem is, that the standard does not have a exact matching between the take and place lines.
This causes problems on splitting the lines.

Please unblock me asap. ­ƒÖÅ

If my solution is successfully tested and the tests are automated, i would like to suggest a feature request and implement it as code contribution.

Describe the request

Object:
table 5767 "Warehouse Activity Line" - CopyItemTrackingToRelatedLine

Code change:

    internal procedure CopyItemTrackingToRelatedLine(xWhseActivLine: Record "Warehouse Activity Line"; FieldNo: Integer)
    var
        WarehouseActivityLine2: Record "Warehouse Activity Line";
	// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	IsHandled: Boolean
	// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<		
    begin
	// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	OnBeforeCopyItemTrackingToRelatedLine(Rec, xWhseActivLine, FieldNo, IsHandled);
	if IsHandled then
	    exit;
	// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		
        if ("Activity Type" in ["Activity Type"::"Invt. Put-away", "Activity Type"::"Invt. Pick"]) then
            exit;

        if "Action Type" <> "Action Type"::Take then
            exit;

        if "Sorting Sequence No." <> 0 then
            WarehouseActivityLine2.SetCurrentKey("Activity Type", "No.", "Sorting Sequence No.");
        WarehouseActivityLine2."Activity Type" := "Activity Type";
        WarehouseActivityLine2."No." := "No.";
        WarehouseActivityLine2."Line No." := "Line No.";
        WarehouseActivityLine2."Sorting Sequence No." := "Sorting Sequence No.";
        WarehouseActivityLine2.SetRange("Whse. Document Type", "Whse. Document Type");
        WarehouseActivityLine2.SetRange("Whse. Document No.", "Whse. Document No.");
        WarehouseActivityLine2.SetRange("Whse. Document Line No.", "Whse. Document Line No.");
        WarehouseActivityLine2.SetRange("Breakbulk No.", "Breakbulk No.");
        WarehouseActivityLine2.SetRange("Source No.", "Source No.");
        WarehouseActivityLine2.SetRange("Source Line No.", "Source Line No.");
        WarehouseActivityLine2.SetRange("Source Subline No.", "Source Subline No.");
        WarehouseActivityLine2.SetRange("Action Type", WarehouseActivityLine2."Action Type"::Place);
        WarehouseActivityLine2.SetTrackingFilterFromWhseActivityLine(xWhseActivLine);
        WarehouseActivityLine2.SetRange("Qty. (Base)", "Qty. (Base)");
        if WarehouseActivityLine2.Find('><') then begin
            WarehouseActivityLine2.CopyTrackingFromWhseActivityLine(Rec);
            WarehouseActivityLine2."Expiration Date" := 0D;
            WarehouseActivityLine2.UpdateExpirationDate(FieldNo);
            WarehouseActivityLine2."Warranty Date" := "Warranty Date";
            WarehouseActivityLine2.Modify();
        end;
    end;

Thank you.
Internal work item: AB#592756

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions