Tuesday, September 12, 2017

Get product attributes and values for all product in AX 2012

Get product attributes and values for all product in AX 2012

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

    while select inventTable
           //where inventTable.ItemId == "TestProduct"
join ecoResProductAttributeValue
         where ecoResProductAttributeValue.Product == inventTable.Product
         join ecoResAttribute where ecoResAttribute.RecId == ecoResProductAttributeValue.Attribute
             join ecoResValue where ecoResValue.RecId == ecoResProductAttributeValue.Value
    {
        info(strfmt("%1,%2, %3", inventTable.ItemId, ecoResAttribute.Name,ecoResValue.value()));
    }
}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...