RE: preventing negative inventory in NAV 2013
You can add following lines in CU 22 > InsertItemLedgEntry function to achieve this.
//Existing Code
IF ItemLedgEntry.Open THEN BEGIN
IF (((ItemLedgEntry."Entry Type" IN
[ItemLedgEntry."Entry Type"::"Negative Adjmt.",
ItemLedgEntry."Entry Type"::Consumption]) AND
("Source Type" = "Source Type"::Item)) OR
(ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
(ItemLedgEntry.Quantity < 0)
THEN
ERROR(Text005,ItemLedgEntry."Item No.");
// Add following two lines
IF (ItemLedgEntry.Quantity < 0) THEN
ERROR(Text005,ItemLedgEntry."Item No.");
This will prevent the posting of Negative Inventory and will take care all the conditions and also would not impact any system performance.