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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Changing the language of the order report for the receving customer

(0) ShareShare
ReportReport
Posted on by 8

I'm having some trouble with the language of the report I'm sending to my customer. Let's say that the customer is Chinese; the only words on my report that will change to Chinese are the date. I have tried different code logic, but can't understand why it's not working. The closest I get to is that it changes to English language; that's about it. I only have two translation files in my project: one for Norwegian language and one for English. My question is, do I have to add translation files for every language out there? How can I solve the problem so the report is set automatically to the customer's language?

Here's the code logic I've tried out:

 
 
reportextension 50105 SalesOrderConfirmationExt extends CR_SalesOrderConfirmation
{
    dataset
    {
        modify(Header)
        {
            trigger OnAfterAfterGetRecord()
            var
                Customer: Record Customer;
                Language: Codeunit Language;
                FormatAddr: Codeunit /Format Address/;
            begin
                Customer.SetRange(/No./, /Sell-to Customer No./);
                if Customer.FindFirst() then begin
                    CurrReport.Language := Language.GetLanguageIdOrDefault(Customer./Language Code/);
                    CurrReport.FormatRegion := Language.GetFormatRegionOrDefault(Customer./Format Region/);
                    FormatAddr.SetLanguageCode(Customer./Language Code/);
                end;
            end;
        }
 
        add(Line)
        {
            column(ProductInfo; ProductInfo) { }
            column(SalesInfo; SalesInfo) { }
            column(Shipping_Agent_Code_Lbl; 'Shipping Agent Code') { }
            column(Shipping_Agent_Code; /Shipping Agent Code/) { }
        }
    }
}
reportextension 50101 CR_CustomPurchaseOrderExt extends CR_CustomPurchaseOrder
{
    dataset
    {
        modify(/Purchase Header/)
        {
            trigger OnAfterAfterGetRecord()
            var
                Language: Codeunit Language;
                FormatAddr: Codeunit /Format Address/;
            begin
                CurrReport.Language := Language.GetLanguageIdOrDefault(/Language Code/);
                CurrReport.FormatRegion := Language.GetFormatRegionOrDefault(/Format Region/);
                FormatAddr.SetLanguageCode(/Language Code/);
            end;
        }
 
        add(/Purchase Header/)
        {
            column(JobDescription; JobDescription) { }
            column(/External_Document_No/; /ExternalDocumentNo/) { }
            column(ExternalDocumentNo_Lbl; 'External document no.') { }
            column(YourReference_Lbl; 'Your reference') { }
            column(Shipping_Agent_Code_Lbl; 'Shipping agent code') { }
            column(Shipping_Agent_Code; Shipping_Agent_Code) { }
        }
        add(/Purchase Line/)
        {
            column(ProductInfo; ProductInfo) { }
            column(SalesInfo; SalesInfo) { }
        }
 
    }
 
}
reportextension 50106 SalesInvoiceExt extends CR_SalesInvoice
{
    dataset
    {
        modify(Header)
        {
 
        /*/
                        trigger OnAfterAfterGetRecord()
                        var
                             Languagemgt: Codeunit Language;
                            FormatAddr: Codeunit /Format Address/;
                            Cust: Record /Customer/;
                            Countrycode: Code[10];
                            CustomerNo: code[20];
                        begin
                           CurrReport.FormatRegion := 'de-DE';
                        end;
         
                      */  
                       
                       
        }
 
        add(Line)
        {
            column(ProductInfo; ProductInfo) { }
            column(SalesInfo; SalesInfo) { }
        }
    }
 
}
I have the same question (0)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans