Very Urgent issue regarding posting Invoice

Hi All DAX Experts,

I have a serious problem regarding posting Invoice. Initially everything works fine. We have developed customizations and everything is working fine. Since we have done some workflow customization, we have compiled the whole appl and run the CIL. It is generated successfully. Here comes the problem. Now we are checking for

  1. Product Receipt - Stack trace error came and it was not posting. So i have unchecked the CIL option from tools → development - > run code from CIL for business…

So now Product receipt posted successfully.

  1. Now we are trying to post invoice . It throws the error " A critical error has occurred in function InventCostInputAmount::getInputAmountFromDistribution." - > this method was called in class PurchInvoiceJournalPost → post inventory method → inputamount calculation.

I have debugged and what is happening is →

After Packing slip-> when i click the Invoice button , two recorsd have been created in Source Document Header and Source Document Line Table and the form opens.

Now what is happening is → after i give Invoice number , consignment number and click the Post Invoice button, again 2 records have been created in Source Document Header and Source Document Line and in the InventCostInputAmount::getInputAmountFromDistribution method, it was searching for the Source Document Line record which was created first time when i click the Invoice button after Packing Slip… but that recid is not there in the Souce Document linc since those records are deleted automatically and those Recid was there in VendinvoiceinfoLine table and since no rec in SDLine table it returs 0 and throws this error and Invice is not hjappening.

This is the standard process and it is not happening . Somebody please help me to resolve this issue …



There was a bug while posting invoices with the consolidation option which gives the same error, were you trying to do the same(trying to consolidate and post the invoices)

Hi Kranthi,

Thanks for your reply … I am just trying for standard invoicing only. But is not happening . If i comment that Cost input method from the PurchinvoiceJournalpost Class → postinventory method, It is invoicing but vouchers are not created. I am breaking my head almost a weak…



KB2729430 has fixed the issue what i have mentioned and which is closely related to your issue. Try by installing that hot-fix.

Hi Kranthi,

I frgt to say one thing. We have also installed one hotfix for tax related issue and then only we run the CIL completely … Can u send me the link which will we very very useful to me… KB - 2797696 which i have installed previously …

Thanks and Regards,