how to get item attribute value on d365 fo x++

     public str getAttributeValue(ItemId _itemid, str _AttrName)

    {

        inventTable                     InventTable;

        EcoResProductAttributeValue     ecoResProductAttributeValue;

        EcoResAttribute                 ecoResAttribute;

        EcoResValue                     ecoResValue;



        select * from

        InventTable


        join EcoResProductAttributeValue

        where ecoResProductAttributeValue.Product == InventTable.Product

        &&  InventTable.itemid == _itemid


        join  ecoResAttribute

        where ecoResProductAttributeValue.Attribute == ecoResAttribute.RecId

        && ecoResAttribute.Name == _AttrName


        join ecoResValue

        where ecoResValue.RecId == ecoResProductAttributeValue.Value;


        return ecoResValue.value()

    }

Comments

Popular posts from this blog

Get Current Worker data in d365 fo x++

Table Level Event Handler in d365 fo x++