
Hi everyone,
I am facing aNl issue in Microsoft Dynamics NAV 2018 when processing Transfer Orders.
On some items, when posting a Transfer Order, the system throws the classic error:
"You can use In-Transit location TRANSIT for transfer orders only."
Upon investigating the database, we found a clear pattern: All items throwing this error have historical entries in the Item Ledger Entry (Table 32) and Value Entry (Table 5802) tables where the Location Code is set to 'TRANSIT', but the Order Type field is completely BLANK (0 instead of 2 for Transfer).
However, I tried to try another item that has order type blank in item ledger entries and see if the same in-transit location error would show. When trying to post a Transfer Order, we got this error: "Item [Item_No] is not in inventory."
We debugged the posting process and caught the exact standard code block where this is triggered:
CheckItemInInventory(TransLine : Record "Transfer Line")
WITH Item DO BEGIN
GET(TransLine."Item No.");
SETFILTER("Variant Filter",TransLine."Variant Code");
SETFILTER("Location Filter",TransLine."Transfer-from Code");
CALCFIELDS(Inventory);
IF Inventory <= 0 THEN
ERROR(Text009,TransLine."Item No.");
END;
To bypass this inventory block and push the code forward to test the In-Transit issue, we tried to post a Positive Adjustment via an Item Journal to add fresh stock.
Surprisingly, the system still blocks us. Even with a positive adjustment line, the system fails with the inventory error. It appears that during CALCFIELDS(Inventory) or the background Automatic Cost Adjustment routine (Adjust Cost - Item Entries), the system loops through the item's history. Because it hits those old entries with the blank Order Type, the calculation breaks in system memory, falsely evaluating the inventory as <= 0.
Has anyone experienced a scenario where a blank Order Type on historical entries blocks both the In-Transit validation and what has happened to these items that all of them have no inventory and can not be posted?
Since these are posted historical entries, what is the safest best practice to fix the blank Order Type field? Should we proceed with a direct SQL Update statement on the Value Entry / Item Ledger Entry tables (setting Order Type = 2)?
Thanks in advance.