To implement this hotfix, you must have a developer license.
You do not have to have rights to the data stores unless you have to perform data repair.
function in the Whse. Jnl.-Register Batch codeunit (7304) as follows:
WhseItemTrkgLine.SETCURRENTKEY(
"Source ID","Source Type","Source Subtype","Source Batch Name",
"Source Prod. Order Line","Source Ref. No.","Location Code");
WhseItemTrkgLine.SETRANGE("Source Type",DATABASE::"Warehouse Journal Line");
WhseItemTrkgLine.SETRANGE("Source ID",WhseJnlLine2."Journal Batch Name");
WhseItemTrkgLine.SETRANGE("Source Batch Name",WhseJnlLine2."Journal Template Name");
WhseItemTrkgLine.SETRANGE("Source Ref. No.",WhseJnlLine2."Line No.");
WhseItemTrkgLine.SETRANGE("Location Code",WhseJnlLine2."Location Code");
IF WhseItemTrkgLine.FINDSET THEN BEGIN
ItemJnlLine.INIT;
ItemJnlLine.VALIDATE("Entry Type",ItemJnlLine."Entry Type"::Transfer);
WITH WhseJnlLine2 DO BEGIN
REPEAT
IF ((WhseItemTrkgLine."New Serial No." <> WhseItemTrkgLine."Serial No.") OR
(WhseItemTrkgLine."New Lot No." <> WhseItemTrkgLine."Lot No.") OR
(WhseItemTrkgLine."New Expiration Date" <> WhseItemTrkgLine."Expiration Date")) THEN BEGIN
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Item Journal Line",
ItemJnlLine."Entry Type",
'',
'',
0,
"Line No.",
WhseItemTrkgLine."Qty. per Unit of Measure",
ABS(WhseItemTrkgLine."Qty. to Handle (Base)"),
WhseItemTrkgLine."Serial No.",
WhseItemTrkgLine."Lot No.");
CreateReservEntry.SetNewSerialLotNo(WhseItemTrkgLine."New Serial No.",WhseItemTrkgLine."New Lot No.");
CreateReservEntry.SetDates(WhseItemTrkgLine."Warranty Date",WhseItemTrkgLine."Expiration Date");
CreateReservEntry.SetNewExpirationDate(WhseItemTrkgLine."New Expiration Date");
CreateReservEntry.CreateEntry(
"Item No.",
"Variant Code",
"Location Code",
Description,
0D,
0D,
0,
ReservEntry."Reservation Status"::Prospect);
QtyToHandleBase += ABS(WhseItemTrkgLine."Qty. to Handle (Base)");
END;
UNTIL WhseItemTrkgLine.NEXT = 0;
IF QtyToHandleBase <> 0 THEN BEGIN
ItemJnlLine."Document No." := "Whse. Document No.";
ItemJnlLine.VALIDATE("Posting Date", "Registering Date");
ItemJnlLine.VALIDATE("Item No.", "Item No.");
ItemJnlLine.VALIDATE("Variant Code","Variant Code");
ItemJnlLine.VALIDATE("Location Code","Location Code");
ItemJnlLine.VALIDATE("Unit of Measure Code", "Unit of Measure Code");
ItemJnlLine.VALIDATE("Quantity (Base)", QtyToHandleBase);
ItemJnlLine.Description := Description;
ItemJnlLine."Source Type" := ItemJnlLine."Source Type"::Item;
ItemJnlLine."Source No." := "Item No.";
ItemJnlLine."Source Code" := "Source Code";
ItemJnlLine."Reason Code" := "Reason Code";
//Delete the following line.
ItemJnlLine."Line No." := "Line No.";
END;
END;
END;
WhseItemTrkgLine.SETCURRENTKEY(
"Source ID","Source Type","Source Subtype","Source Batch Name",
"Source Prod. Order Line","Source Ref. No.","Location Code");
WhseItemTrkgLine.SETRANGE("Source Type",DATABASE::"Warehouse Journal Line");
WhseItemTrkgLine.SETRANGE("Source ID",WhseJnlLine2."Journal Batch Name");
WhseItemTrkgLine.SETRANGE("Source Batch Name",WhseJnlLine2."Journal Template Name");
WhseItemTrkgLine.SETRANGE("Source Ref. No.",WhseJnlLine2."Line No.");
WhseItemTrkgLine.SETRANGE("Location Code",WhseJnlLine2."Location Code");
IF WhseItemTrkgLine.FINDSET THEN BEGIN
ItemJnlLine.INIT;
//Add the following line.
ItemJnlLine."Line No." := WhseJnlLine2."Line No.";
ItemJnlLine.VALIDATE("Entry Type",ItemJnlLine."Entry Type"::Transfer);
WITH WhseJnlLine2 DO BEGIN
REPEAT
IF ((WhseItemTrkgLine."New Serial No." <> WhseItemTrkgLine."Serial No.") OR
(WhseItemTrkgLine."New Lot No." <> WhseItemTrkgLine."Lot No.") OR
(WhseItemTrkgLine."New Expiration Date" <> WhseItemTrkgLine."Expiration Date")) THEN BEGIN
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Item Journal Line",
ItemJnlLine."Entry Type",
'',
'',
0,
"Line No.",
WhseItemTrkgLine."Qty. per Unit of Measure",
ABS(WhseItemTrkgLine."Qty. to Handle (Base)"),
WhseItemTrkgLine."Serial No.",
WhseItemTrkgLine."Lot No.");
CreateReservEntry.SetNewSerialLotNo(WhseItemTrkgLine."New Serial No.",WhseItemTrkgLine."New Lot No.");
CreateReservEntry.SetDates(WhseItemTrkgLine."Warranty Date",WhseItemTrkgLine."Expiration Date");
CreateReservEntry.SetNewExpirationDate(WhseItemTrkgLine."New Expiration Date");
CreateReservEntry.CreateEntry(
"Item No.",
"Variant Code",
"Location Code",
Description,
0D,
0D,
0,
ReservEntry."Reservation Status"::Prospect);
QtyToHandleBase += ABS(WhseItemTrkgLine."Qty. to Handle (Base)");
END;
UNTIL WhseItemTrkgLine.NEXT = 0;
IF QtyToHandleBase <> 0 THEN BEGIN
ItemJnlLine."Document No." := "Whse. Document No.";
ItemJnlLine.VALIDATE("Posting Date", "Registering Date");
ItemJnlLine.VALIDATE("Item No.", "Item No.");
ItemJnlLine.VALIDATE("Variant Code","Variant Code");
ItemJnlLine.VALIDATE("Location Code","Location Code");
ItemJnlLine.VALIDATE("Unit of Measure Code", "Unit of Measure Code");
ItemJnlLine.VALIDATE("Quantity (Base)", QtyToHandleBase);
ItemJnlLine.Description := Description;
ItemJnlLine."Source Type" := ItemJnlLine."Source Type"::Item;
ItemJnlLine."Source No." := "Item No.";
ItemJnlLine."Source Code" := "Source Code";
ItemJnlLine."Reason Code" := "Reason Code";
END;
END;
END;