Skip to main content
Business Central forum
Unanswered

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

editSubscribe (0) ShareShare
ReportReport
Posted on by

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, then, 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:

pastedimage1600781037851v1.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

pastedimage1600781051761v2.png

Categories:

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,244 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,919 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans