Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

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

editSubscribe (0) ShareShare
ReportReport
Posted on by
 
 
 
 
 
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;
 
 
  • 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 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…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Featured topics

Product updates

Dynamics 365 release plans