how to get the inventdimid value form the itemid in ax 2012 ?

hi all ,

i develop a report which stock sales , based on itemid ,i want to get the inventdimid , all the table strucutre changed in 2012

can any body know pls help me



select RecId from ecoResProductMasterLocal

where ecoResProductMasterLocal.DisplayProductNumber == “611261104”;

while select * from ecoResproductMasterConfiguration

where ecoResproductMasterConfiguration.ConfigProductMaster == ecoResProductMasterLocal.RecId



//tmpInventDimId = configTable.inventDim().inventDimId;


inventDim.ConfigId = EcoResConfiguration::find(ecoResproductMasterConfiguration.Configuration).Name;

tmpInventDimId = inventdim::findOrCreate(inventDim).inventDimId;