Skip to main content
Dynamics 365 general forum
Suggested answer

problems changing the language of a custom report for a invoice,

editSubscribe (0) ShareShare
ReportReport
Posted on by 8
 
 
 
 
 
i get this error: A language that is not supported has been selected (DE - The requested culture is not supported by the current platform)
Code: 
 
            trigger OnAfterAfterGetRecord()
            var
                Languagemgt: Codeunit Language;
                FormatAddr: Codeunit /Format Address/;
                Cust: Record /Customer/;
                Countrycode: Code[10];
                CustomerNo: code[20];
               langcodeint: integer;
              //1031 de-DE
            begin
                Cust.Get(/Bill-to Customer No./);    
                Countrycode := Cust./Country/Region Code/;
                CurrReport.FormatRegion := Languagemgt.GetFormatRegionOrDefault(Countrycode);
                FormatAddr.SetLanguageCode(Countrycode);
                   case Countrycode  of
                 'DE':
                 langcodeint := 1031
                end;
                CurrReport.Language :=  langcodeint;
                CurrReport.Language :=Languagemgt.GetLanguageIdOrDefault(Countrycode);
            end;
 
 
Attachments
  • problems changing the language of a custom report for a invoice,
    Thanks for answearing Mohamed Amine, i tried your solution, and it's still not working :)
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 4,118 User Group Leader on at
    problems changing the language of a custom report for a invoice,
    Hi,
     
    Try this code :
    trigger OnAfterAfterGetRecord()
    var
        Languagemgt: Codeunit Language;
        Cust: Record "Customer";
    begin
        Cust.Get("Bill-to Customer No.");
        CurrReport.Language := Languagemgt.GetLanguageIdOrDefault(Cust."Country/Region Code");
    end;
    Best regards,
    Mohamed Amine MAHMOUDI

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Demystifying Copilot with Sundar Raghavan

Sundar explains how Copilot for Service is meant to function separately...

Business Process Guidance Badges and New…

The Microsoft Success by Design is the framework for implementing Dynamics 365…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,254 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,958 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans