Hi guys, Today we see how to release product variants in ax 2012 using X++.
static void releaseProductVariantsToReleasedProduct(Args _args)
{
EcoResProductReleaseManagerBase releaseManager;
EcoResProductMaster ecoResProductMaster;
EcoResDistinctProductVariant ecoResDistinctProductVariant;
Name configId;
container con,dimensionvalues;
int i=1;
RefRecId _productMasterRecId;
con = ['1004','1005','1006'];
_productMasterRecId = 52565460661;
ecoResProductMaster = EcoResProductMaster::find(_productMasterRecId);
for (i=1 ; i<=conLen(con) ; i++)
{
configId = conPeek(con,i);
select firstOnly ecoResDistinctProductVariant
where ecoResDistinctProductVariant.ProductMaster == ecoResProductMaster.RecId
&& ecoResDistinctProductVariant.DisplayProductNumber == EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions(ecoResProductMaster.productNumber(),
EcoResProductVariantDimValue::getDimensionValuesContainer(configId));
if (ecoResDistinctProductVariant && !ecoResDistinctProductVariant.isReleased())
{
releaseManager = EcoResProductReleaseManagerBase::newFromProduct(ecoResDistinctProductVariant);
releaseManager.release();
}
}
info('Product variants released');
}
Create Product master Dimensions and Variants in Ax 2012 using X++
Keep Daxing!!
No comments:
Post a Comment