Hi all i use Dynamics AX 2012 R3 and right now i get some issue because i can get the item cost backdated.
i try to get from inventory value report summary but in this report i just can get the cost for the item that still have stock on system, but if there is some item that already don't have the stock but in that month we have transaction for that item, i can't get the item cost. can any one help me to get this with X++ code or there is some class i can used?
i try to used this job before but still can't
static void SL_FindItemCostPriceAsPerDate(Args _args)
{
InventDim inventDimCriteria;
ItemId itemId;
InventDimParm inventDimParm;
date perDate = mkDate(28,3,2016);
InventOnHand inventOnHand;
;
itemId = '010100002';
inventDimCriteria.inventBatchId = '123456';
inventDimParm.initFromInventDim(inventDimCriteria);
inventOnHand = InventOnhand::newParameters(itemId, inventDimCriteria, inventDimParm);
info(strfmt('%1', inventOnHand.costPricePcs(false, perDate)));
}
i try to used this but there is always 0