最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Find product attributes and values for an item in AX 2012 via X++

网络文摘 William 76浏览 0评论
In the event you need to see what the product attributes are while debugging some stuff, run the below script.

This is for AX 2012 but probably works for D365, I'm not sure. Give it a shot.

It literally takes an item id and gives you the attributes and values in those attributes. Pretty straight forward

static void DAXGetProductAttributes(Args _args)
{
    EcoResProductAttributeValue ecoResProductAttributeValue;
    EcoResAttribute             ecoResAttribute;
    EcoResValue                 ecoResValue;
    ItemId                      itemId      = 'A10021'; // This is a sample Item Id
    InventTable                 inventTable = InventTable::find(itemId);

    while select RecId from ecoResProductAttributeValue
         where ecoResProductAttributeValue.Product   == inventTable.Product
         join Name from ecoResAttribute
             where ecoResAttribute.RecId                 == ecoResProductAttributeValue.Attribute
             join ecoResValue
               where ecoResValue.RecId                     == ecoResProductAttributeValue.Value
    {
        info(strFmt("%1 - %2 - %3", InventTable.ItemId, ecoResAttribute.Name, ecoResValue.value()));
    }
}
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址