static void createProductVariant(Args _args)
{
ecoResDistinctProductVariant ecoResDistinctProductVariant;
EcoResProductVariantDimensionValue EcoResProductVariantDimensionValue;
RefRecId ecoResDistinctProductVariantRecId;
EcoResProductReleaseManagerBase releaseManager;
container productDimensions;

//Create a container to hold dimension values
productDimensions = EcoResProductVariantDimValue::getDimensionValuesContainer(”,
”,
‘Black’,
”);
//Create Product search name
ecoResDistinctProductVariant.DisplayProductNumber = EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions(
EcoResProduct::find(InventTable::find(“IDB-PM002”).Product).productNumber(),
productDimensions);

//Create Product variant with Product and dimensions provided
ecoResDistinctProductVariantRecId = EcoResProductVariantManager::createProductVariant(InventTable::find(“IDB-PM002”).Product,ecoResDistinctProductVariant.DisplayProductNumber,productDimensions);

//Find newly created Product Variant
ecoResDistinctProductVariant = ecoResDistinctProductVariant::find(ecoResDistinctProductVariantRecId);
//Now release the Product variant
releaseManager = EcoResProductReleaseManagerBase::newFromProduct(ecoResDistinctProductVariant);
releaseManager.release();
}