Quantcast
Channel: Microsoft Dynamics Ax
Viewing all articles
Browse latest Browse all 181

Get product attributes from X++

$
0
0

The product attributes is a nice feature, where we can add attributes to the products without adding any additional fields on to the inventory table.
image
But I wanted to be able to fetch out only the attribute names and values from X++, that had values.
image
Here is how I solved it.

static void Demo_GetProductAttributes(Args _args)
{
inventTable InventTable;
EcoResProductAttributeValue ecoResProductAttributeValue;
EcoResAttribute ecoResAttribute;
EcoResValue ecoResValue;

while select InventTable where InventTable.itemid == "1604"
join RecId from ecoResProductAttributeValue
where ecoResProductAttributeValue.Product == InventTable.Product
join Name from ecoResAttribute
where ecoResProductAttributeValue.Attribute == ecoResAttribute.RecId
join ecoResValue
where ecoResValue.RecId == ecoResProductAttributeValue.Value
{
info(strFmt("%1 - %2 - %3", InventTable.ItemId, ecoResAttribute.Name, ecoResValue.value()));
}
}

Viewing all articles
Browse latest Browse all 181

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>