Get the name of product from EcoResProduct or InventTable Dynamics ax

Does anyone know how to get the name of a product from EcoResProduct on Dynamics ax on a Job?

I found some things like I have to use the EcoResProductTraslation, but I cant find the relation or something to get the name.

2 Answers

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. Please check the example below:

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 investigate the code of function to understand what it actually does. Also you can use cross references to find examples where it is used.

2

The data structure is indeed a bit tricky, but thankfully AX standard already has a display method that does the heavy lifting for you: EcoResProduct.displayProductName()

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like