To Get X++ code to get Average cost price for Item as per selected date in ax 2012(Axapta) , you can try below code in job.
Below X++ code to get Transit Warehouse stock on hand . You can try on Job and run. Thanks. InventSum inventSum; InventDim inventDim; InventDimParm inventDimParm; InventLocation inventLocation; Qty qtyPhysical, qtyOrdered, qtyAvailable; WarehouseId transitWarehouseId = 'TRN0001'; // Replace with your transit warehouse ID // Find the warehouse record inventLocation = InventLocation::find(transitWarehouseId); if (!inventLocation) { info(strFmt("Warehouse %1 not found.", transitWarehouseId)); return; } // Build dimension parameters inventDimParm.initFromInventDim(InventDim::find(inventLocation.InventLocationId)); // Query InventSum for stock in the transit warehouse while select inventSum join inventDim...