How to stop Negative Inventory??

navuser1
Member Posts: 1,334
Hi All,
Is there any setup in Navision3.7 to stop the transactions which are going to create a negative inventory?
Is there any setup in Navision3.7 to stop the transactions which are going to create a negative inventory?
Now or Never
0
Comments
-
No standard code. You have to make it.Regards,
Deep
India0 -
No.Regards,
Deep
India0 -
navuser1 wrote:Hi All,
Is there any setup in Navision3.7 to stop the transactions which are going to create a negative inventory?
Use "Lot Tracking" on all items. The systems does not allow "Lot Tracked" items to go negative. You may need to re-think some of the business process to support this change.There are no bugs - only undocumented features.0 -
ok...
If I want to put my code then where is write place in Codeunit 22 to check the same.
In which function of codeunit 22 I use to write my code.Now or Never0 -
You should probably have an experienced developer do it. You could easily break something.
That said, if you are the only one who can do it, there is a function in C22 called InsertItemLedgEntry. Be careful.0 -
Hello I've done this for many clients as Mattrax mentioned it's in CU 22 function InsertItemLedgEntry.
The function already does not allow negative inventory for consumption entries.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.");
text005 is 'Item %1 is not on inventory.'
You add your own code below it.//Mod Start if (ItemLedgEntry.Quantity < 0) THEN ERROR(Text005,ItemLedgEntry."Item No.");
//Mod End[/code]0 -
fine..
I have choosen the right function.
And my code is
InvtSetup.GET;
Item.GET(ItemLedgEntry."Item No.");
Item.SETFILTER("Date Filter",'..%1', ItemJnlLine."Posting date");
Item.SETFILTER("Location Filter",'%1',ItemLedgEntry."Location Code");
Item.CALCFIELDS("Net Change");
IF NOT InvtSetup."Allow Neg. Invt." THEN
IF (Item."Net Change" + ItemLedgEntry.Quantity) < 0 THEN
ERROR(Text005A,Item."No.",ItemJnlLine."Posting Date");
Text005A =
The quantity in the Inventory is not sufficient to cover net change in the inventory
for Item No. %1 on date %2.';Now or Never0 -
I wouldn't do it this way. Just follow the code example I've written above.
One problem with your code is, what they are already negative on inventory?
They will get the error no matter what.//Mod Start IF NOT InvtSetup."Allow Neg. Invt." THEN if (ItemLedgEntry.Quantity < 0) THEN ERROR(Text005,ItemLedgEntry."Item No."); //Mod End
Plus your code is slow. You are doing calculating a flow field for every entry.0 -
navuser1 wrote:Hi All,
Is there any setup in Navision3.7 to stop the transactions which are going to create a negative inventory?
Out of the box, you can enable warehouse management. This will prevent inventory from going negative.
Search the forum, there are a TON of discussions on this.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Thanks to Alex and Ara3n.Now or Never0
-
As i know you can use bins (bin mandatory) and you will not be allowed to go negative0
-
ara3n wrote:Hello I've done this for many clients as Mattrax mentioned it's in CU 22 function InsertItemLedgEntry.
The function already does not allow negative inventory for consumption entries.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.");
text005 is 'Item %1 is not on inventory.'
You add your own code below it.//Mod Start if (ItemLedgEntry.Quantity < 0) THEN ERROR(Text005,ItemLedgEntry."Item No.");
//Mod End[/code]Now or Never0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions