Hi guys, Today we see how to delete product master dimensions in ax 2012 using X++. Just run the below job.
static void deleteProductDimensions(ItemId _itemId, ConfigName _processId) { EcoResConfiguration ecoResConfiguration; EcoResProductMaster ecoResProductMaster; EcoResDistinctProductVariant ecoResDistinctProductVariant; EcoResProductMasterConfiguration productMasterConfiguration; if (_itemId && _processId) { select firstOnly DisplayProductNumber from ecoResProductMaster where ecoResProductMaster.DisplayProductNumber == _itemId; if (ecoResProductMaster.DisplayProductNumber) { ecoResConfiguration = EcoResConfiguration::findByName(_processId); if (ecoResConfiguration) { delete_from ecoResDistinctProductVariant where ecoResDistinctProductVariant.ProductMaster == ecoResProductMaster.RecId && ecoResDistinctProductVariant.DisplayProductNumber == EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions( ecoResProductMaster.DisplayProductNumber, EcoResProductVariantDimValue::getDimensionValuesContainer(ecoResConfiguration.Name)); delete_from productMasterConfiguration where productMasterConfiguration.ConfigProductMaster == ecoResProductMaster.RecId && productMasterConfiguration.Configuration ==ecoResConfiguration.recid; } } } } }
Keep Daxing !!
No comments:
Post a Comment