Hello awesome community! :)
I'm still a newbie in AX so please bear with me explaining haha.
I've created a report that shows the expired items.
My query is :
InventTrans > InventDim > InventBatch
So, I want to check all the transaction of the items to look for expired items that is still remaining.
The data is big so it takes a long time in Loading screen and then it gives me an error saying that "connection is lost"
But If I used a filter like for example: item number, it will work fine. So my problem is when I want to get all the data.
I used a query Object in AOT with a DP Class.
Here is my prcoessReport method code:
qr = new QueryRun(query); while(qr.next()){ invTrans = qr.get(tableNum(InventTrans)); InvDim = qr.get(tableNum(InventDim)); InvBatch = qr.get(tableNum(InventBatch)); if(InvBatch.expDate < today() || InvBatch.expDate - InventTable::find(invTrans.ItemId).NearExpiry < today()){ reportLine.ItemId = invTrans.ItemId; reportLine.ItemName = invTrans.itemName(); reportLine.Qty = invTrans.Qty; reportLine.inventBatchId = InvDim.inventBatchId; reportLine.InventLocationId = InvDim.InventLocationId; reportLine.expDate = InvBatch.expDate; reportLine.insert(); }
}
Please, if you can advice it would be appreciated :)
Maybe using a select and a while select is faster and better than using a "query object"?
NOTE*: I check if the items still remaining or not in the design. If the Sum of quantity in the batch id is "0 Zero" that means no items are remaining so I will hide the records from the table. Maybe there is a better work around? since it will fetch un-needed data.
Thanks in advance!
*This post is locked for comments