Create Product Variant
static void CreateProductVariant(Args _args) { ecoResDistinctProductVariant ecoResDistinctProductVariant; EcoResProductVariantDimensionValue EcoResProductVariantDimensionValue; RefRecId ecoResDistinctProductVariantRecId; EcoResProductReleaseManagerBase releaseManager; container productDimensions; InventTable inventTable=InventTable::find("item"); //Create a container to hold dimension values productDimensions = EcoResProductVariantDimValue::getDimensionValuesContainer("ConfigurationName", "Size", "ColorId", "InventStyleId"); //Create Product search name ecoResDistinctProductVariant.DisplayProductNumber = EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions( EcoResProduct::find(InventTable.Product).productNumber(), productDimensions); //Create Product variant with Product and dimensions provided ecoResDistinctProductVariantRecId = EcoResProductVariantManager::createProductVariant(InventTable.Product,ecoResDistinctProductVariant.DisplayProductNumber,productDimensions); //Find newly created Product Variant ecoResDistinctProductVariant = ecoResDistinctProductVariant::find(ecoResDistinctProductVariantRecId); //Now release the Product variant releaseManager = EcoResProductReleaseManagerBase::newFromProduct(ecoResDistinctProductVariant); releaseManager.release(); }