Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to add Product name based on language selection

Posted on by 1,879

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,879 on at
    RE: How to add Product name based on language selection

    Hi Experts,

    Waiting for help.

    Thanks,

    Faiz

  • faiz7049 Profile Picture
    faiz7049 1,879 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,879 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... 291,269 Super User 2024 Season 2 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,879 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... 291,269 Super User 2024 Season 2 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?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans