Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

How to add Product name based on language selection

Posted on by 1,641

Hi Experts,

I need to add Product name in Sales invoice. In product tranlsation , I have added arabic name under language "Arabic(ar)".

Please help me.

3823.Language.jpg

Thanks,

Faiz

  • Verified answer
    MCallebert Profile Picture
    MCallebert 45 on at
    RE: How to add Product name based on language selection

    Hi faiz.

    You're calling 

    EcoResProductTranslation::findByProductLanguage(this.itemId(_custInvoiceTrans),ar);

    This method awaits 2 parameters :

    - 1 product (refrecid)

    - 1 languageid

    And returns 1 object (EcoResProductTranslation)

    So there are 3 problems in your code:

    1) you give an itemid instead of a product

    2) you give a variable name "ar" that has not been decleared instead of a languageid

    3) You're not telling wich field of EcoResProductTranslation you want to put in your 

    salesInvoiceTmp.NameAR

    So the proper way to call this method should be :

    EcoResProductTranslation::findByProductLanguage(InventTable::find(this.itemId(_custInvoiceTrans)).product,"ar").Description));

  • faiz7049 Profile Picture
    faiz7049 1,641 on at
    RE: How to add Product name based on language selection

    Hi Experts,

    Waiting for help.

    Thanks,

    Faiz

  • faiz7049 Profile Picture
    faiz7049 1,641 on at
    RE: How to add Product name based on language selection

    Hi Andre,

    I tried using below code. Getting error "Variable has not been decleared".

    salesInvoiceTmp.NameAR=EcoResProductTranslation::findByProductLanguage(this.itemId(_custInvoiceTrans),ar);

    Please help me.

    Thanks,

    Faiz

  • faiz7049 Profile Picture
    faiz7049 1,641 on at
    RE: How to add Product name based on language selection

    Hi Andre,

    How and which filter I have to apply for get "language=Arabic(ar)" with field "Product Name".

    Because in Language there are Arabic and English. 

    Language1.jpg

    Thank,

    Faiz

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,835 Super User on at
    RE: How to add Product name based on language selection

    HI Faiz,

    If you want to concatenate values, you need to rerieve the Arabic name. You can find the record using the find() method on the EcoResProductTranslation table.

  • faiz7049 Profile Picture
    faiz7049 1,641 on at
    RE: How to add Product name based on language selection

    Hi Andre,

    We are using customized report.

    In data provider

    salesInvoiceTmp.ItemDescription=_custInvoiceTrans.salesLine().itemName();

    Through above code we are getting Product name. I want to include (concatenate) arabic name also. As in above screen shot, arabic name is fixed in "Product name" if language is selected "Arabic(ar)".

    Both Sales order and Customer language is "en-us"

    How to get Arabic text to Sales invoice report.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,835 Super User on at
    RE: How to add Product name based on language selection

    Hi Faiz,

    Are you using the standard invoice report , data provider or do you have a custom report data provider?

    What is the language selected on the customer and the sales order?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans