Product attributes value by item id using X++
Hi Technical,
Today, in this post we are going to share a piece of code to fetch product attributes value by item id using X++ in AX 2012 R2/R3.
Create a AOT job and copy paste the below code:
Author:
Chirag Gupta
Microsoft Dynamics 365 AX Technical Consultant at IBM Bangalore
Date:
28-Jan-2020
Happy Learning !!
Today, in this post we are going to share a piece of code to fetch product attributes value by item id using X++ in AX 2012 R2/R3.
Create a AOT job and copy paste the below code:
// Created By: Chirag Gupta
// Created Date: 28-Jan-20
// Summary: Get product attributes values by item id.
static void PKA_GetProductAttributes(Args _args)
{
InventTable inventTable;
EcoResProductAttributeValue ecoResProductAttributeValue;
EcoResAttribute ecoResAttribute;
EcoResValue ecoResValue;
while select inventTable where inventTable.ItemId == "FGBRDASS0001"
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()));
}
}
We hope this article helped you to fetch product attributes values by item id. Please comment your valuable feedback for this article...// Created Date: 28-Jan-20
// Summary: Get product attributes values by item id.
static void PKA_GetProductAttributes(Args _args)
{
InventTable inventTable;
EcoResProductAttributeValue ecoResProductAttributeValue;
EcoResAttribute ecoResAttribute;
EcoResValue ecoResValue;
while select inventTable where inventTable.ItemId == "FGBRDASS0001"
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()));
}
}
Author:
Chirag Gupta
Microsoft Dynamics 365 AX Technical Consultant at IBM Bangalore
Date:
28-Jan-2020
Happy Learning !!
Comments
Post a Comment