Below is the X++ query for getting the product variants.
InventDimCombination inventDimCombination;
InventDim inventDim;
while select inventDimCombination
where inventDimCombination.ItemId == '1000'
join inventDim
where inventDim.inventDimId == inventDimCombination.InventDimId
{
info(strFmt('%1 : %2 : %3 : %4 : %5',
inventDimCombination.DistinctProductVariant,
inventDim.configId,
inventDim.InventColorId,
inventDim.InventSizeId,
inventDim.InventStyleId));
}
InventDimCombination inventDimCombination;
InventDim inventDim;
while select inventDimCombination
where inventDimCombination.ItemId == '1000'
join inventDim
where inventDim.inventDimId == inventDimCombination.InventDimId
{
info(strFmt('%1 : %2 : %3 : %4 : %5',
inventDimCombination.DistinctProductVariant,
inventDim.configId,
inventDim.InventColorId,
inventDim.InventSizeId,
inventDim.InventStyleId));
}