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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Insufficient stock transactions with Status Purchased.

(0) ShareShare
ReportReport
Posted on by

Dear Experts,

Im having a trouble to post the suppliers invoice. With following error message shown below2055.ERROR.png

Here's full transaction list for ST1009A part

invoice-err2.png

I`ve also checked every single one of them to make sure there's no discrepancies/mismatch on PO received quantity or Invoice  values.  They all seems to be ok. 

invoice-ERROR-2.png

Any suggestions how to solve this issue are welcome

Kind Regards

V

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Viz,

    Just delete the first line on your InventTrans table with status Ordered Qty 6,611

    This should solve the problem.

    S

  • Community Member Profile Picture
    on at

    Hi Carsz,

    Thank you very much. It solved the problem and invoice is finally posted.

    V

  • Raj K Chattopadhyay Profile Picture
    100 on at

    Perfect answer.

    Appreciated..

  • Mohd Zuber Saifi Profile Picture
    172 on at

    Hi 

    problem is solve but my question is, is it ok to delete a line from inventtrans?

    and what is the cause for this error?

  • Community Member Profile Picture
    on at

    Hi Viesturs Silins,

    post is old but the same issue is still coming in AX 2012 and 2012 R2.

    recently i faced the same issue in AX 2012 R2 CU7 with Those PO's which are Partially GRN, mean each line will have tow records in InventTrans table one with status received another with status ordered which is causing error and deleting entry will delete ordered status where you can't create GRN for remaining Qty.

    i went in to details and the error is coming  checkLineAfterPosting method  of PurchInvoiceJournalPost class.

    i was able to solved it by just adding one more condition to ignore Ordered status as well.

    Old Code

    if (purchLine.RemainPurchFinancial == 0 && purchLine.RemainPurchPhysical == 0)

       {

           select firstonly RecId from inventTrans

               where ((purchLine.PurchQty >= 0

    && inventTrans.StatusReceipt != StatusReceipt::Purchased

    && inventTrans.StatusReceipt != StatusReceipt::None)

                   || (purchLine.PurchQty <  0 && inventTrans.StatusIssue   != StatusIssue::Sold && inventTrans.StatusIssue != StatusIssue::None))

               exists join inventTransOriginPurchLine

                   where inventTransOriginPurchLine.InventTransOrigin      == inventTrans.InventTransOrigin

                      && inventTransOriginPurchLine.PurchLineDataAreaId    == purchLine.DataAreaId

                      && inventTransOriginPurchLine.PurchLineInventTransId == purchLine.InventTransId;

           if (inventTrans.RecId)

           {

               if (purchLine.PurchQty < 0)

               {

                   ok = checkFailed(strFmt("@SYS54028", StatusIssue::Sold));

               }

               else

               {

                   ok = checkFailed(strFmt("@SYS54028", StatusReceipt::Purchased));

               }

               ok = checkFailed("@SYS115807");

           }

       }

    New Code

    if (purchLine.RemainPurchFinancial == 0 && purchLine.RemainPurchPhysical == 0)
    {
    select firstonly RecId from inventTrans
    where ((purchLine.PurchQty >= 0

    && inventTrans.StatusReceipt != StatusReceipt::Purchased

    && inventTrans.StatusReceipt != StatusReceipt::None
    && inventTrans.StatusReceipt != StatusReceipt::Ordered)
    || (purchLine.PurchQty < 0 && inventTrans.StatusIssue != StatusIssue::Sold && inventTrans.StatusIssue != StatusIssue::None))
    exists join inventTransOriginPurchLine
    where inventTransOriginPurchLine.InventTransOrigin == inventTrans.InventTransOrigin
    && inventTransOriginPurchLine.PurchLineDataAreaId == purchLine.DataAreaId
    && inventTransOriginPurchLine.PurchLineInventTransId == purchLine.InventTransId;

    if (inventTrans.RecId)
    {
    if (purchLine.PurchQty < 0)
    {
    ok = checkFailed(strFmt("@SYS54028", StatusIssue::Sold));
    }
    else
    {
    ok = checkFailed(strFmt("@SYS54028", StatusReceipt::Purchased));
    }

    ok = checkFailed("@SYS115807");
    }

    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans