
Open Retail Statement > Posting open statement gives error "Function InventTrans.inventMovement has been used incorrectly"
We are experiencing this error at one of our client's production environment (Dynamics AX 2012 R2 CU7). I have debugged the issue thoroughly and found that while constructing the InventMovement class for one of the movements (InventTrans), the originator (Table InventTransOrigin method call to method: originator(), queries
respective table for related data, in our case RetailtransactionSalesTrans table since 150 (Statement) in ReferenceID field in InventTransOrigin table) is not found.
Later while returning this movement object, its originator (buffer()) is validated and since not initialized, the IF condition is not met, so no variable is returned, the underlying condition is evaluated, which is met as true and gives the error.
Process Knowledge
As far as I have investigated and inquired my colleagues, the process is that,
First all sales transactions / movements are compiled / calculated
System then generates an SO (on runtime)
When posting the SO, InventTrans aare generated to post the inventory physically
Posting is completed
Now during this process and somewhere in the InventUpdate classes, the invetMovement method is called which then looks that the request is from Statement (150) with Retail congif key ON, tries to find a record in RetailTransactionSalesTrans which is not there.
Hence the issue is identified, but the question is, if a Retail Statement is open, should such statements and their transactions have records in InventTrans and InventTransOrigin ?
How is it possible that ITO has reference category to 150 (retail statement) and reference ID = valid retail statement (open state) has no reference record in RetailTransactionSalesTrans.
Is it a bug ? Is their any hotfix available ? If it is not, how to resolve it ? Any one else experienced it ?
Kindly help me regarding this
*This post is locked for comments
I have the same question (0)Hello,
I'm facing the same issue with my Retail customer, some transactions in inventory are marked with a statement which is already posted. the quantity is reserved and not posted.
later when i try to use any item with this issue in a transfer, I have the error "Function InventTrans.inventMovement has been used incorrectly."
The description you provided of the issue is correct, and I guess this is due to a bad internet connection when the server is trying to synchronize sales transactions from the store to the server (I'm not sure). I faced this issue with only one store which have a bad and non stable internet connection.
I learned on internet that the fact to delete lines from inventtrans will solve the issue. is it right?
What was the solution you applied in your case?
Thank you in advance.
Hatem