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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 414 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 352

#3
Martin Dráb Profile Picture

Martin Dráb 275 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans