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 :
Finance | Project Operations, Human Resources, ...
Suggested answer

Item Stock Inquiry difference makes no sense

(0) ShareShare
ReportReport
Posted on by 75,848 Moderator

We have a client with a strange difference on the Item Stock Inquiry screen. For 1 item it has 5 potential locations. Four trucks and the shop. Stock is constantly taken out of the shop and put on the trucks. For some peculiar reason when we look at this item for the shop location, the site quantity does not equal the stock quantity. On the four trucks all is fine. The screenshot on the left is the shop and one of the trucks is on the right. Looking at the data I see nothing different about the U/M's for the transactions.Can anyone shed some light as to what may be causing this? What stored procedure(s) is running to produce the data in the grid? If I could pick apart the sp perhaps I could discover what is happening here.

SHOP_2D00_ITEMINQUIRY.png

Categories:
I have the same question (0)
  • Suggested answer
    Hokuminaria Profile Picture
    2,950 on at
    RE: Item Stock Inquiry difference makes no sense

    Hello Richard,

    When we get support cases on the Item Stock Inquiry, we provide how this window functions. Please see how the window works below.

    Item Stock Inquiry

    pastedimage1588958399059v2.png

    The window pulls from 2 main tables.

    • IV00102
    • IV30300

    The totals and balances are pulling from different tables.  Above the Total Stock quantity and all the lower fields in the bottom part of the window are stored in IV00102.  If the balances in IV00102 are wrong, the window will calculate the balance at the top incorrectly.

    See the On hand value = 5.  If you look in table IV00102 this matches the ONHAND field in the table. 

    The IV30300 is where the detail (inflows and outflows ie. 000000000000112, STDINV2237, 0000000000000113) is pulling from.  The system uses the quantities in these tables in its calculation to get to the balance (4).

    It starts with the balance in the IV00102 and works its way backwards (starting at the bottom of the window) through transactions in the IV30300.  Once it gets to the last transaction in the table (based on date) the system puts that balance at the top of the page for the “balance”.  See screenshot above, 4 is the balance.

    Example below:

    pastedimage1588958408961v3.png

    They have 5 on hand.

    5 – 3 = 2.  The balance is 2 at the top, but they think it should be 4 because the Inflow record was 4.

    Balance at the top is just a calculation

    The issue in this case is there is a missing record in the IV30300 for a sale of 2.  It uses the IV00102 to get the onhand balance, but then uses the IV30300 to “back out” the quantities from the transactions. Since the Sales transaction for a transaction quantity of 2 (STDINV2267) was deleted out of the table, the balance won’t match the first record coming in causing confusion.

    Reasons why the balance can be off based on cases.

    1. Not maintaining IV history.
    2. Removed data via SQL from the IV30300.
    3. Posting interruption where data didn’t make it into the IV history tables.
    4. Changed U of M equivalent.   1 each is the base, 6 each= 1 case.  Customer changes the equivalent and now 8 each = 1 case.  The system allows you to change the U of M equivalent, but there is no warning that this will be the ramifications of this act (working as designed).  A better solution for customers is to create a whole new UofM. 
    5. Serial/lot quantity overrides. (See below). Brought in 3, sold 5 and overwrote quantity. (See screenshot below)

    pastedimage1588958424434v4.png

    We also have the KB article below that has additional information pertaining to the Item Stock Inquiry window.

    https://support.microsoft.com/en-us/help/2647425/the-balance-in-item-stock-inquiry-is-incorrect-in-microsoft-dynamics-g

    When I capture a SQL Trace of the window loading, I only see one Stored Proc. This is ivFillStockInquiryScrollingWindowTempTable.

    I hope this helps!

    Thank you!

    Microsoft Support Engineer | Brandon Jarratt

  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: Item Stock Inquiry difference makes no sense

    Brandon, you just saved my weekend. I will use this to get a head start on my investigation. Now I do not need to run SQL Profiler to find the sp.  I need to find out why this one location for this one item has this issue.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 835 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans