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.");
//Start 001
if (ItemLedgEntry.Quantity < 0) then
ERROR(Text005,ItemLedgEntry."Item No.");
//End 001
Ahmed Rashed Amini
Independent Consultant/Developer
I think that situation is not so easy as ara3n wrote, because:
1. Users can post entries with date preceding last posted entries and inventory shoud not be negative in any date
2. Revaluation (adjustation) and hours accounting from production module entries deals with quantity too but doesn't cause inventory changes
1. You first issue. Item application is not date sensetive, Application is done in fifo, unless you have serial or lot no assigned. At which case you'll get Item tracking error that the item is not in inventory.
2. Second issue. Reevaluation does not create any Item Ledger Entry. The change in code errors out when item ledger is inserted.
If you look at the code. It already errors out if let's say you try to post a consumption journal. My code changes basically applies it to any entry type.
I've done this for a client a year ago. Haven't had any issues, provided when you implement this change that all your inventory is positive.
Ahmed Rashed Amini
Independent Consultant/Developer
Yes, this small change is working, I can confirm that. We are using it nearly for all customers... :-) you can easilly modify it to just not let users to sell into negative nos., or block it in generally...
I don't get it!
lubost has a point ... users can post entries with date preceding last posted entries! I mean if I sell in January an item that I produced in February then it's still wrong and further development is needed to prevent that! This small change is correct only if the users enter information in real-time!
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
1. Users can post entries with date preceding last posted entries and inventory shoud not be negative in any date
2. Revaluation (adjustation) and hours accounting from production module entries deals with quantity too but doesn't cause inventory changes
1. You first issue. Item application is not date sensetive, Application is done in fifo, unless you have serial or lot no assigned. At which case you'll get Item tracking error that the item is not in inventory.
2. Second issue. Reevaluation does not create any Item Ledger Entry. The change in code errors out when item ledger is inserted.
If you look at the code. It already errors out if let's say you try to post a consumption journal. My code changes basically applies it to any entry type.
I've done this for a client a year ago. Haven't had any issues, provided when you implement this change that all your inventory is positive.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
lubost has a point ... users can post entries with date preceding last posted entries! I mean if I sell in January an item that I produced in February then it's still wrong and further development is needed to prevent that! This small change is correct only if the users enter information in real-time!