Search code examples
c#dynamics-crmdynamics-crm-2013

Get all enabled languages for a CRM organisation


A simple question that I have not found an answer for. In Dynamics CRM 2013 (or any other version for that matter), is there a way to programmatically retrieve a list of all enabled languages in an organisation?

It's easy to get the base/default language by querying the languagecode field in the organization entity. But how can I get all the other languages?

My application is in C# and is external to CRM so no JavaScript please. This should be served by the web services.


Solution

  • You can use the RetrieveProvisionedLanguagesRequest to retrieve all languages that are enabled for the organization you are connected to:

    var req = new RetrieveProvisionedLanguagesRequest();
    var res = (RetrieveProvisionedLanguagesResponse)service.Execute(req);
    

    Here res.RetrieveProvisionedLanguages is an int array of locale ID values that represent the provisioned languages.