Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

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

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;
 
 
  • DS-10050821-0 Profile Picture
    DS-10050821-0 8 on at
    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 9,536 Super User 2024 Season 2 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

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans