NAV 2016 - Get Sales Shipment Lines fails because Sales Order has been deleted

One of my clients has managed to delete Sales Orders where Lines have been shipped, but not invoiced.

This has caused several issues with the Inventory Valuation, as they never used Expect Cost posting, so the result is that Items were produced via Production Orders, had an associated cost, but when the Shipment was done, no expected cost posted, and the Inventory items have Qty= 0, but a Cost.

The first option was to try the Get Shipment Lines on a Sales Invoice, but it fails, as there are no Sales Lines for the Sales Orders.

Trying the orders from the archive - fails, due to the fact that the orders are partially posted. Creating new orders is not an option, because it needs to have a shipped qty, that one can invoice.

I tried doing Item Journals, doing a positive adjustment, then running adjust cost item entries, but due to the FIFO costing method, the cost is not associated to the new qty, and the negative adjustment does not remove the cost.

My next option was to try Combine Shipments (but fails for the same reason as Get Shipment Lines), then try to run “Post Cost to G/L”, which also failed.

Anyone out there who has managed to overcome this scenario before? Any sage advice will be highly appreciated.

The client has done somethinng that is not allowed in standard NAV! Either the standard triggers that validate deletion have been disabled, or the order has been deleted with a batch that bypasses the triggers [using DELETE(FALSE)] or the order has been deleted directry in SQL.

What ever - the order has to be re-created with a batch.
Only that way you can re-create the order with all fields “properly” filled in as the original: Same OrderNo, same Line-No’s, Quantity=X, Qty. to Ship=0, Qty. to Invoice=X, Qty. to Ship=0, Quantity Shipped=X, Outstanding Quantity, … and so on. A manual procedure.

If you ask how to do this - then don’t!


Adding to Anfinnur’s reply… You have to add back the Order and first you need to find out how this happened. Then make sure you correct this from ever happening again.