Keep from negative stock

Hi, I need a way to be able to register an order, but not be able to Ship or Invoice if the Inventory should become negative. Perhaps some code to prevent the ‘Qty. to Ship’ field to be updated if the stock amount is not sufficient ? Any suggestions please ?

I forgot to mention that I’m running Navision version 3.70.a sorry …

Hi Does this help or give you ideas? http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=8457

Seems interesting. Only thing is: do you know which code to put where in codeunit 22 ?

Steven: Thanks for the hint, I think perhaps the Reserve option on the item card could be good enough for me !

Or on second thought , I think not. We use an integration from web generating orders in to Navision, and we want to use ‘Post batch’ to more or less automatic invoice all that can be invoiced. Orders with amounts not on stock should result in restorders for the missing amount.

Hi I think the best option is to talk to your NSC and have it developed. It does not seem to be too much work looking at the post, the hard part I suppose will be getting it configured with your current modifications.

Codeunit 22, in the InsertItemLedgEntry function: WITH ItemJnlLine DO BEGIN IF ItemLedgEntry.Open THEN BEGIN //>> start new code InvtSetup.GET; // we added this field to Inventory Setup IF NOT InvtSetup."Allow Negative Inventory" THEN BEGIN IF ItemLedgEntry.Quantity < 0 THEN ERROR('error message'); END; //<< end new code IF (((ItemLedgEntry."Entry Type" IN This will cause the system to error out whenever it tries to insert an open/negative Item Ledger Entry, which is roughly what you are looking for. If you don’t (want to) have a field in the Inventory Setup, just add the error message.

Daniel: Thanks a lot, this was exactly what I was looking for. Now the only thing I need to code is a way to ship and invoice the amount I have on stock That is : if I have on stock 2 items, ant try to ship and invoice 5, then I want to ship and invoice 2 items, and have a rest of 3 items.