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.
But I wanted to be able to fetch out only the attribute names and values from X++, that had values.
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()));
}
}
Hi Kurt,
Thanks a lot, you saved me a lot of time and energy. Also, it’s very good learning. Thanks. π
LikeLike
Hi Kurt,
I want to get Retail Attribute text value of SalesLine for a particular Attribute.
And I am not sure how to get it. Please suggest how get it.
LikeLike
Hi,
Did you find this? Can you reply with the table name where these values are stored
LikeLike
I just had to quickly write this in SQL this gets me what I want
SELECT
d.TEXTVALUE AS textvalue,
a.ITEMID AS itemid,
c.name
FROM InventTable a,
ecoResProductAttributeValue b,
ecoResAttribute c,
ecoResValue d
WHERE a.PRODUCT = b.PRODUCT
AND b.ATTRIBUTE = c.RECID
AND b.VALUE = d.RECID
AND c.ATTRIBUTETYPE = ‘5637151588’ –specify attribute
LikeLiked by 1 person
Thanks, really helpful post .
I have a question , what if i need to get this from all in SQL query not in X++ extension ?
Can you please help me in that .
LikeLike
Hi. For those kind of question I suggest posting them on the community forums.
LikeLike
OK, thanks . can you please send me appropriate link to post such questions
LikeLike
https://community.dynamics.com/ax
LikeLike
Thanks
LikeLike
Hello,
I want create relation between inventTable and Product attribute value. The purpose is to use Product attribute in any AX report as filter/ criteria. Is it possible?
LikeLike
thanx its very useful..
LikeLike
your post is very helpful. Thank you so much for sharing…..
LikeLike
Hi
Do you know why you can not use the Office Add-in tool to update the table InventTableModule, something you can do to have it fixed?
What I would like to use it for is to have a better overview over our prices and update from Excel to AX with new prices. It is the last part for me that does not work, To push back new prices from Excel to AX
LikeLike
Hi Claes.
The AX 2012 R1/FP had about 40% table coverage, as I’m sure that you have experienced. Microsoft has learned from this, and in the R2 release scheduled for 1/12/2012 they Increase this to 95% coverage. So this is the solution…. wait until R2 (if possible).
The other thing I learned at the Tech Conferance this week, was some VERY NICE features in the Retail module, that you should look into. It’s called Mass Update Worksheet. I think this feature will solve many of Your issues of updating prices and other Properties on the InventtableModule. Take a look here : http://technet.microsoft.com/en-us/library/hh580603.aspx
Keep fighting Claes, it’s Worth it π
LikeLike
Thank you for the good information you continuouslypublish, makes my work easier
LikeLike