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 :
Microsoft Dynamics AX (Archived)

Translations on ProductDimension Lookup

(0) ShareShare
ReportReport
Posted on by

How can I customize the ProductDimension Lookup to see the Translation values for a customer language

so when I try to select values with the lookup on an order I want to the Translation for the Dimension in customer language like this:

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ivan (Vanya) Kashperuk Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    The form displayed for product dimensions lookup on, e.g., Sales orders, is called "InventProductDimensionLookup". That's the one you'd need to modify.

    Just to be clear, currently the translation of the product dimension name is not shown at all on that form on the first tab. You want to add it there, I assume?

  • Community Member Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    Yes you are rigth I wanna add the translations there

  • Ivan (Vanya) Kashperuk Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    OK, so I guess that answers your question then? Or do you need some additional help in how to actually add the translation there?

  • Community Member Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    some additional help would be nice...

  • Suggested answer
    Ivan (Vanya) Kashperuk Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    1. Add a new form level variable of type LanguageId, called custLanguageId.

    2. Add a method on the data source InventDimDimension called custProductName() with the below code:

    public display EcoResProductName custProductName(InventDim _inventDimDimension)

    {

       FieldId dimFieldId = element.inventDimSetupObject().parmMainSortFieldId();

       ItemId  callerItemId = element.inventDimSetupObject().callerItemId();

       return EcoResProductMasterDimValueTranslation::findByProductMasterDimValLanguage(

           EcoResProductMasterSize::find(InventTable::find(callerItemId).product, EcoResSize::findByName(_inventDimDimension.(dimFieldId)).RecId).RecId,

           custLanguageId).name;

    }

    3. Drag the method over to the grid GridDimension on the first tab page, and make sure to set the datasource on the control to InventDimDimension

    4. In the init method on the form, add the following code:

       FormDataSource      lineDS;

       SalesLine           salesLine;

    ...

       lineDS = callerControl.dataSourceObject().joinSourceDataSource();

       if (lineDS.table() == TableNum(SalesLine))

       {

           salesLine = lineDS.cursor();

           //custLanguageId = CustTable::find(salesLine.CustAccount).languageId();

           custLanguageId = salesLine.salesTable().LanguageId;

       }

    That should do it.

    You would of course need to "beautify" this code, and make sure it shows up when it needs to and not at other times (I gave an example above with checking for the table being SalesLine, but you could also check based on the field, the item, the form calling the lookup, etc.)

  • Ivan (Vanya) Kashperuk Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    Did this answer your question?

  • Community Member Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    Currently I am not sure. First I have to get the code running because it is not compiling and than I have to extend to work for all dimensions (config, size, Color, ...)

  • Ivan (Vanya) Kashperuk Profile Picture
    on at
    RE: Translations on ProductDimension Lookup

    The lookup form is one for all product dimensions, so it will be shown for config,color,size and style automatically when you get the code compiled.

    what seems to be the compilation issues?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans