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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...