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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to get the Product Name for the ItemID in forms

(0) ShareShare
ReportReport
Posted on by 454

Hi,

I have one form with datasource Inventtable,Ecoresproduct,EcoresproductTranslation I have to show in the grid with fields ItemID,Product name. How to get the corresponding Product Name for that ItemID. 

Regards,

Ram

I have the same question (0)
  • Blue Wang Profile Picture
    on at
    RE: How to get the Product Name for the ItemID in forms

    Hi Ram,

    As mentioned, the method InventTable.productName() might be useful for your purpose. The method finds a product variant that is based on the value of the _inventDimId parameter. If the product variant is found then its name is returned; otherwise, the name of a product that this item represents is returned.

    InventTable           inventTable;
    EcoResProduct         ecoResProduct;
    EcoResProductName     productName;
    ;
    
    inventTable = InventTable::find('AnyItemId');          
    productName = inventTable.productName(SystemParameters::getSystemLanguageId());
    
    info(productName);
    
    ecoResProduct = EcoResProduct::find(inventTable.Product);         
    productName   = ecoResProduct.productName();
    
    info(productName);

    You can use cross references to learn more examples.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to get the Product Name for the ItemID in forms

    Just look at method InventTable.productName to see how you can fetch the product name for item id. You will notice that there could be 50 names for the same item, one for each language. So you need to decide and handle it in a way that the name is shown in the language that you want to use.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,239

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 767 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 672 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans