web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

get Item category in X++

(0) ShareShare
ReportReport
Posted on by 335

private void getItemCategory(ItemId _itemid)
{
ItemId itemId = "ITEMNO-000000572";//"ITEMID-000104";
EcoResProductCategory EcoResProductCategory;
EcoResCategory EcoResCategory;
EcoResProduct EcoResProduct;
InventTable InventTable;
;

select EcoResCategory
join EcoResProductCategory
join EcoResProduct
join InventTable
where EcoResCategory.RecId == EcoResProductCategory.Category
&& EcoResProduct.RecId == EcoResProductCategory.Product
&& EcoResProduct.RecId == InventTable.Product
&& InventTable.ItemId== itemid ;

{
info(strFmt("%1",EcoResCategory.Name));
//return EcoResCategory.Name;

}
}

*This post is locked for comments

I have the same question (2)
  • Martin Dráb Profile Picture
    239,932 Most Valuable Professional on at

    Why are you spamming this forum with code snippets without any explanation? What kind of help are you looking for here?

    Also, please use </> button in the rich formatting view to paste source code.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    You can get the Category name from the EcoResCategory table.

    Here is the query.

    select * from EcoResCategory
    join EcoResProductCategory
    join Inventtable
    where EcoResCategory.RecId == EcoResProductCategory.Category
    && EcoResProductCategory.Product == Inventtable.Product
    && Inventtable.ItemId ==  'ItemId';

    info(strfmt('%1', EcoResCategory.CODE));

    Let me know if you have any questions.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans