AX 2012 R3: Error Insufficient inventory transactions with status Purchased.

Hi Guys,

Yesterday i have received a support request where i need to investigate this error, due to this error user is not able to post the Pending Vendor invoice. When i start investigating this issue, the Purchase order, Receipt and Invoice looks pretty simple with one line on it.

After lots of talk and finding more details, i am seeing wearied Ordered quantity value of 140860. I did not find any clue from where this quantity came. Other wise order looking very simple with 48 quantity as Purchase order quantity and they have received the same Quantity also. They also wanted to do the Invoice for Same quantity.

Further strange thing is, With same Ordered value the record is created in Inventory transaction also and this is the main reason Invoice is not able to POST. This additional line from un-know source is messing this invoice from posting.I am still not known on how this line came but to fix this issue i have to delete this additional line as a workaround. Being a technical guy i am not satisfied as still i am unable to reach the root cause. But this is LIFE we have to move on. So i have created this simple job to remove that extra line.

 static void legJob12(Args _args)  
 {  
   PurchLine purchLine;  
   InventTrans inventTrans;  
   InventTransOrigin origin;  
   ttsBegin;  
   changeCompany("0N09")  
   {  
     purchLine = purchLine::find("0N09-0002000507",1);  
     select firstonly * from inventTrans  
     join origin  
     where inventTrans.InventTransOrigin == origin.RecId  
     && origin.InventTransId == purchLine.InventTransId  
     && inventTrans.StatusReceipt == StatusReceipt::Ordered;  
     if (inventTrans.RecId)  
     {  
       inventTrans.selectForUpdate(true);  
       inventTrans.delete();  
     }  
   }  
   ttsCommit;  
   info('completed');  
 }  

If someone know any better solution, please do comment and help me satisfied.

Thanks Guys for reading the blogs

2 Responses to AX 2012 R3: Error Insufficient inventory transactions with status Purchased.

  1. Ashok says:

    Hi Amir

    Did you tried inconsistency check before deleting this record?

  2. khaled alloud says:

    It our case it was that the invoice is linked to the wrong product receipt (cancelled one), the user changed the link from the Retrieve purchase order button

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: