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.
Note: 10/26/11 there was a slight change to this KB to make the code inline with code that was published for NAV 5.0SP1. The functionality has not changed. Specific lines that changed are in the "Add" section of the replacement code;
Line : InventoryProfile."Line No." := LineNo; change to : InventoryProfile."Line No." := NextLineNo;
Line : LineNo := LineNo +1; was removed.
...
InventoryProfile.SETCURRENTKEY("Line No.");
SalesLine.SETCURRENTKEY(Type,"No.","Variant Code","Drop Shipment","Location Code","Document Type","Shipment Date");
SalesLine.SETFILTER("Document Type",'%1|%2',SalesLine."Document Type"::Order,SalesLine."Document Type"::"Return Order");
SalesLine.SETRANGE(Type,SalesLine.Type::Item);
SalesLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",SalesLine."Location Code");
Item.COPYFILTER("Variant Filter",SalesLine."Variant Code");
SalesLine.SETFILTER("Outstanding Qty. (Base)",'<>0');
SalesLine.SETFILTER("Shipment Date",'>%1&<=%2',0D,ToDate);
IF SalesLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromSalesLine(SalesLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL SalesLine.NEXT = 0;
ServiceLine.SETCURRENTKEY(Type,"No.","Variant Code","Location Code","Posting Date");
ServiceLine.SETRANGE("Document Type",ServiceLine."Document Type"::Order);
ServiceLine.SETRANGE(Type,ServiceLine.Type::Item);
ServiceLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",ServiceLine."Location Code");
Item.COPYFILTER("Variant Filter",ServiceLine."Variant Code");
ServiceLine.SETFILTER("Outstanding Qty. (Base)",'<>0');
ServiceLine.SETFILTER("Posting Date",'>%1&<=%2',0D,ToDate);
IF ServiceLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromServiceInvLine(ServiceLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL ServiceLine.NEXT = 0;
ReqLine.SETCURRENTKEY("Ref. Order Type","Ref. Order Status","Ref. Order No.","Ref. Line No.");
ReqLine.SETRANGE("Ref. Order Type",ReqLine."Ref. Order Type"::"Prod. Order");
ProdOrderComp.SETCURRENTKEY("Item No.","Variant Code","Location Code",Status,"Due Date");
ProdOrderComp.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Location Filter",ProdOrderComp."Location Code");
Item.COPYFILTER("Variant Filter",ProdOrderComp."Variant Code");
ProdOrderComp.SETRANGE(Status,ProdOrderComp.Status::Planned,ProdOrderComp.Status::Released);
ProdOrderComp.SETFILTER("Due Date",'>%1&<=%2',0D,ToDate);
IF ProdOrderComp.FIND('-') THEN
REPEAT
ReqLine.SETRANGE("Ref. Order Status",ProdOrderComp.Status);
ReqLine.SETRANGE("Ref. Order No.",ProdOrderComp."Prod. Order No.");
ReqLine.SETRANGE("Ref. Line No.",ProdOrderComp."Prod. Order Line No.");
ReqLine.SETRANGE("Operation No.",'');
IF NOT ReqLine.FIND('-') THEN BEGIN
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromComponent(ProdOrderComp,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
END;
UNTIL ProdOrderComp.NEXT = 0;
PlanningComponent.SETCURRENTKEY("Item No.","Variant Code","Location Code","Due Date");
PlanningComponent.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Location Filter",PlanningComponent."Location Code");
Item.COPYFILTER("Variant Filter",PlanningComponent."Variant Code");
PlanningComponent.SETFILTER("Due Date",'>%1&<=%2',0D,ToDate);
IF PlanningComponent.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromPlanComponent(PlanningComponent,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL PlanningComponent.NEXT = 0;
TransferReqLine.SETCURRENTKEY(Type,"No.","Variant Code","Transfer-from Code","Transfer Shipment Date");
TransferReqLine.SETRANGE("Replenishment System",TransferReqLine."Replenishment System"::Transfer);
TransferReqLine.SETRANGE(Type,TransferReqLine.Type::Item);
TransferReqLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",TransferReqLine."Transfer-from Code");
Item.COPYFILTER("Variant Filter",TransferReqLine."Variant Code");
TransferReqLine.SETFILTER("Transfer Shipment Date",'>%1&<=%2',0D,ToDate);
IF TransferReqLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromOutboundTransfPlan(TransferReqLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL TransferReqLine.NEXT = 0;
TransLine.SETCURRENTKEY("Item No.");
TransLine.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Variant Filter",TransLine."Variant Code");
Item.COPYFILTER("Location Filter",TransLine."Transfer-from Code");
TransLine.SETFILTER("Shipment Date",'>%1&<=%2',0D,ToDate);
FilterIsSetOnLocation := Item.GETFILTER("Location Filter") <> '';
IF TransLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromOutboundTransfer(TransLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
IF FilterIsSetOnLocation THEN
InventoryProfile."Transfer Location Not Planned" := TransferLocationIsFilteredOut(Item,TransLine);
InventoryProfile.INSERT;
UNTIL TransLine.NEXT = 0;
...
...
InventoryProfile.SETCURRENTKEY("Line No.");
SalesLine.SETCURRENTKEY(Type,"No.","Variant Code","Drop Shipment","Location Code","Document Type","Shipment Date");
SalesLine.SETFILTER("Document Type",'%1|%2',SalesLine."Document Type"::Order,SalesLine."Document Type"::"Return Order");
SalesLine.SETRANGE(Type,SalesLine.Type::Item);
SalesLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",SalesLine."Location Code");
Item.COPYFILTER("Variant Filter",SalesLine."Variant Code");
SalesLine.SETFILTER("Outstanding Qty. (Base)",'<>0');
SalesLine.SETFILTER("Shipment Date",'>%1&<=%2',0D,ToDate);
// Add the following line.
SalesLine.SETRANGE("Build Kit",FALSE);
// End of the line.
IF SalesLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromSalesLine(SalesLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL SalesLine.NEXT = 0;
// Add the following lines.
KitSalesLine.SETCURRENTKEY("Document Type",Type,"No.","Variant Code","Location Code","Shipment Date");
KitSalesLine.SETRANGE("Document Type",KitSalesLine."Document Type"::Order);
KitSalesLine.SETRANGE(Type,KitSalesLine.Type::Item);
KitSalesLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",KitSalesLine."Location Code");
Item.COPYFILTER("Variant Filter",KitSalesLine."Variant Code");
KitSalesLine.SETFILTER("Outstanding Qty. (Base)",'<>0');
KitSalesLine.SETFILTER("Shipment Date",'>%1&<=%2',0D,ToDate);
IF KitSalesLine.FINDFIRST THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromKitSalesLine(KitSalesLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL KitSalesLine.NEXT = 0;
// End of the lines.
ServiceLine.SETCURRENTKEY(Type,"No.","Variant Code","Location Code","Posting Date");
ServiceLine.SETRANGE("Document Type",ServiceLine."Document Type"::Order);
ServiceLine.SETRANGE(Type,ServiceLine.Type::Item);
ServiceLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",ServiceLine."Location Code");
Item.COPYFILTER("Variant Filter",ServiceLine."Variant Code");
ServiceLine.SETFILTER("Outstanding Qty. (Base)",'<>0');
ServiceLine.SETFILTER("Posting Date",'>%1&<=%2',0D,ToDate);
IF ServiceLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromServiceInvLine(ServiceLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL ServiceLine.NEXT = 0;
ReqLine.SETCURRENTKEY("Ref. Order Type","Ref. Order Status","Ref. Order No.","Ref. Line No.");
ReqLine.SETRANGE("Ref. Order Type",ReqLine."Ref. Order Type"::"Prod. Order");
ProdOrderComp.SETCURRENTKEY("Item No.","Variant Code","Location Code",Status,"Due Date");
ProdOrderComp.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Location Filter",ProdOrderComp."Location Code");
Item.COPYFILTER("Variant Filter",ProdOrderComp."Variant Code");
ProdOrderComp.SETRANGE(Status,ProdOrderComp.Status::Planned,ProdOrderComp.Status::Released);
ProdOrderComp.SETFILTER("Due Date",'>%1&<=%2',0D,ToDate);
IF ProdOrderComp.FIND('-') THEN
REPEAT
ReqLine.SETRANGE("Ref. Order Status",ProdOrderComp.Status);
ReqLine.SETRANGE("Ref. Order No.",ProdOrderComp."Prod. Order No.");
ReqLine.SETRANGE("Ref. Line No.",ProdOrderComp."Prod. Order Line No.");
ReqLine.SETRANGE("Operation No.",'');
IF NOT ReqLine.FIND('-') THEN BEGIN
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromComponent(ProdOrderComp,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
END;
UNTIL ProdOrderComp.NEXT = 0;
PlanningComponent.SETCURRENTKEY("Item No.","Variant Code","Location Code","Due Date");
PlanningComponent.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Location Filter",PlanningComponent."Location Code");
Item.COPYFILTER("Variant Filter",PlanningComponent."Variant Code");
PlanningComponent.SETFILTER("Due Date",'>%1&<=%2',0D,ToDate);
IF PlanningComponent.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromPlanComponent(PlanningComponent,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL PlanningComponent.NEXT = 0;
TransferReqLine.SETCURRENTKEY(Type,"No.","Variant Code","Transfer-from Code","Transfer Shipment Date");
TransferReqLine.SETRANGE("Replenishment System",TransferReqLine."Replenishment System"::Transfer);
TransferReqLine.SETRANGE(Type,TransferReqLine.Type::Item);
TransferReqLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",TransferReqLine."Transfer-from Code");
Item.COPYFILTER("Variant Filter",TransferReqLine."Variant Code");
TransferReqLine.SETFILTER("Transfer Shipment Date",'>%1&<=%2',0D,ToDate);
IF TransferReqLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromOutboundTransfPlan(TransferReqLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL TransferReqLine.NEXT = 0;
TransLine.SETCURRENTKEY("Item No.");
TransLine.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Variant Filter",TransLine."Variant Code");
Item.COPYFILTER("Location Filter",TransLine."Transfer-from Code");
TransLine.SETFILTER("Shipment Date",'>%1&<=%2',0D,ToDate);
FilterIsSetOnLocation := Item.GETFILTER("Location Filter") <> '';
IF TransLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile."Item No." := Item."No.";
InventoryProfile.TransferFromOutboundTransfer(TransLine,TempItemTrkgEntry);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
IF FilterIsSetOnLocation THEN
InventoryProfile."Transfer Location Not Planned" := TransferLocationIsFilteredOut(Item,TransLine);
InventoryProfile.INSERT;
UNTIL TransLine.NEXT = 0;
...