Dynamics 365 Business Central: How to get Microsoft Entra tenant registered country letter code and preferred language in AL

Dynamics 365 Business Central

Hi, Readers.
Today I would like to share another mini tip about Business Central, how to get Microsoft Entra tenant registered country letter code and preferred language in AL.
These two are not information in Business Central environment, but from the tenant. If you do not have access to Azure Portal or Microsoft 365 admin center, you cannot see this information.

First, let’s look at the Microsoft Entra tenant registered country letter code:
In Azure Portal:

In Microsoft 365 admin center:

Note:
You can’t change the country/region for your subscription. The country/region where your organization is headquartered determines which services are available to you, the taxes and billing currency, and the location of the data center. To change your organization’s country/region, sign up for a new account, choose the desired country or region, and buy a new subscription. More details: Change your country/region

And, Microsoft Entra tenant registered preferred language:

In AL, we can get them easily. Let’s see more details.

In codeunit 433 “Azure AD Tenant”, there are two standard methods.
procedure GetCountryLetterCode(): Gets the current Microsoft Entra tenant registered country letter code.

For example,

procedure GetPreferredLanguage(): Gets the current Microsoft Entra tenant registered preferred language.

For example,

The preferred language can be changed. (My test tenant only has English and Spanish)

Very simple, give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL