Skip to content

[Bug]: "Item Tracking Setup" does not copy the tracking for "Posted Invt. Pick Line" correctly #29673

@GonzaloGuerraVicente

Description

@GonzaloGuerraVicente

Describe the issue

The table 6565 "Item Tracking Setup" has the procedure "CopyTrackingFromPostedInvtPutAwayLine", which copies the Lot and the Serial number.
After a call to this procedure the "Package No." is not copied to the "Item Tracking Setup".
The procedure has the event publisher "OnAfterCopyTrackingFromPostedInvtPutAwayLine", in other cases like the "OnAfterCopyTrackingFromWhseActivityLine" the "Package No." is correctly tranfer to "Item Tracking Setup" with a subscription at the codeunit 6516 "Package Management". I believe the same should occur in this case to maintain consistency.

"Item Tracking Setup" procedure:

procedure CopyTrackingFromPostedInvtPutAwayLine(PostedInvtPutAwayLine: Record "Posted Invt. Put-Away Line")
begin
    "Serial No." := PostedInvtPutAwayLine."Serial No.";
    "Lot No." := PostedInvtPutAwayLine."Lot No.";

    OnAfterCopyTrackingFromPostedInvtPutAwayLine(Rec, PostedInvtPutAwayLine);
end;

Existing "Package Management" subscriber:

[EventSubscriber(ObjectType::Table, Database::"Item Tracking Setup", 'OnAfterCopyTrackingFromWhseActivityLine', '', false, false)]
local procedure ItemTrackingSetupCopyTrackingFromWhseActivityLine(var ItemTrackingSetup: Record "Item Tracking Setup"; WhseActivityLine: Record "Warehouse Activity Line")
begin
      ItemTrackingSetup."Package No." := WhseActivityLine."Package No.";
end;

Proposed "Package Management" subscriber:

[EventSubscriber(ObjectType::Table, Database::"Item Tracking Setup", OnAfterCopyTrackingFromPostedInvtPickLine, '', false, false)]
local procedure ItemTrackingSetupCopyTrackingFromPostedInvtPickLine(var ItemTrackingSetup: Record "Item Tracking Setup"; PostedInvtPickLine: Record "Posted Invt. Pick Line")
begin
      ItemTrackingSetup."Package No." := PostedInvtPickLine."Package No.";
end;

Expected behavior

Correctly tranfer "Package No." to "Item Tracking Setup" with a subscription at the codeunit 6516 "Package Management".

Steps to reproduce

Declare variables for the posted line and the tracking:

PostedInvtPickLine: Record "Posted Invt. Pick Line";
WhseItemTrackingSetup: Record "Item Tracking Setup";

Find a line with "Package No." value assigned, and call the procedure CopyTrackingFromPostedInvtPickLine

WhseItemTrackingSetup.CopyTrackingFromPostedInvtPickLine(PostedInvtPickLine);

Check the value of "Package No.", wich is empty.

Additional context

No response

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions