Skip to main content

Notifications

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;
 
 
  • 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 4,246 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

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 223,096 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans