Trying to stop shipping if not enough inventory.
Using Nav3.7, have the following code in codeunit 22 just after InsertItemLedgEntry and the system still let's me ship when no inventory. Can anyone tell me what I did wrong?
WITH ItemJnlLine DO BEGIN
IF ItemLedgEntry.Open THEN BEGIN
IF (((ItemLedgEntry."Entry Type" IN
[ItemLedgEntry."Entry Type"::"Negative Adjmt.",
ItemLedgEntry."Entry Type"::Consumption,
ItemLedgEntry."Entry Type"::Sale]) AND
("Source Type" = "Source Type"::Item)) OR
(ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
(ItemLedgEntry.Quantity < 0)
THEN
ERROR(Text005,ItemLedgEntry."Item No.");
Help is greatly appreciated!
Catherine :-k
0
Comments
i suggest to add new code and don't modify the existing if statement
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
=D>
Try this:
http://wiki.dynamicsbook.com/index.php? ... ory_in_NAV
and check the box
Stock Out Warning
then if you try to put an item on a sales order without stock on hand, a pop up a warning box will appear.
If you edit the form, to hide the yes button it can't be entered on an order.
Not quite what you were looking for, but it also doesn't require any programming.