web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

preventing negative inventory in NAV 2013

(0) ShareShare
ReportReport
Posted on by 12

Hello Everyone,
Greetings!
I need some ideas on how to prevent negative inventory in NAV 2013.It's easy in other versions but How can I customize the objects in NAV 2013 to prevent negative inventory?
Any kind of help will be appreciated.
Thanks In Advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at
    RE: preventing negative inventory in NAV 2013

    in nav 2013 (r1, 7.0) that needs a customization. for that please contact your nav partner.

    this feature is available in nav standard with vs. >= 2013 r2.

  • Verified answer
    Community Member Profile Picture
    on at
    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.

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at
    RE: preventing negative inventory in NAV 2013

    Versions which came before 2013 R2 does not have the option to block the negative inventory using a setup and you required to do a small modifications to the "Item Jnl.-Post Line" code unit. As Vishal mention in the code unit go to the InsertItemLedgEntry function and in that add two lines.

    IF (ItemLedgEntry.Quantity < 0) THEN
        ERROR(Text005,ItemLedgEntry."Item No.");
    

    save and compile. You are ready to go.

    With-Code.JPG

  • Sulav Thapaliya Profile Picture
    12 on at
    RE: preventing negative inventory in NAV 2013

    Thank You Sir

  • Harsha Kumara Profile Picture
    25 on at
    RE: preventing negative inventory in NAV 2013

    Tnx for the reply

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#2
SC666 Profile Picture

SC666 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans