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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Business Central forum / “‘X’ is not a valid la...
Business Central forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

“‘X’ is not a valid language code. You must specify a locale identifier (LCID)” error is thrown when deploying extensions through automation APIs

Posted on by Microsoft Employee

You might have implemented, with Dynamics 365 Business Central SaaS, your own solution to deploy extensions automagically through whatever programming language or using PostMan or via logicApps.

It could happen that when performing a PATCH call like e.g.

 

api.businesscentral.dynamics.com/.../content

 

that you might receive an error like

 

{

  "error": {

    "code": "Unknown",

    "message": "'<integerNumber>' is not a valid language code. You must specify a locale identifier (LCID) or code in the format of language-country/region, such as en-US, de-DE, or da-DK.  CorrelationId:  <GUID>."

  }

}

 

The rationale behind this error is related on mimic the equivalent of specifying the deployment language as it happens from the Extensions Management UI as shown below:

pastedimage1600775403507v1.png 

 

When using the automation API, the Language is taken from the session language and sometimes a wrong or null value might raise the error described.

Meanwhile development team is analyzing why this is happening and to resolve it in the medium term, the viable solution for this issue is to always include in the Headers the following entry

 

"Accept-Language" : "en-US"

?

Or whatever valid language you would like to use in your deployment (typically English).

This will be intercepted by the application and converted from LCID into its equivalent Language code and used as GLOBALLANGUAGE within the following sentence in the ExtensionManagement codeunit

 pastedimage1600775403507v2.png

 

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans