how to display the product attributes for and Item

Hi all,

In Product information management/Common/Released products

select an item number and click on Product attribute" button form the Action Panel of setup group in ax 2012.

it opens a form Product attribute values with

  1. Product group and value ,

  2. product subgroup and value

  3. product type and value

I want to get the Product product group and its value as well as product type and value w.r.t the Item number we selected and display it on the report.

Help please

solution :

http://kurthatlevik.wordpress.com/2012/05/21/get-product-attributes-from-x/

Get product attributes from X++Posted on May 21, 2012 by Kurt Hatlevik

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()));
    }
}