This documentation is archived and is not being maintained.

RetrieveProvisionedLanguages Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment typesWorks online only

Retrieves the list of language packs installed on the server that have been enabled.

The relevant classes are specified in the following table.



To use this message, pass an instance of the RetrieveProvisionedLanguagesRequest class as the request parameter in the Execute method.

For a list of required privileges, see RetrieveProvisionedLanguages Privileges.


The following code example demonstrates how to use the RetrieveProvisionedLanguages message.

// Set up the CRM service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Retrieve the Locale IDs from the server.
RetrieveProvisionedLanguagesRequest request = new RetrieveProvisionedLanguagesRequest();
RetrieveProvisionedLanguagesResponse response = (RetrieveProvisionedLanguagesResponse)Service.Execute(request);

// Create a CultureInfo array that represents the available languages.
System.Globalization.CultureInfo[] cultures =
    new System.Globalization.CultureInfo[response.RetrieveProvisionedLanguages.Length];

for (int i = 0; i < response.RetrieveProvisionedLanguages.Length; i++)
    cultures[i] = System.Globalization.CultureInfo.GetCultureInfo(response.RetrieveProvisionedLanguages[i]);
[Visual Basic .NET]
' Set up the CRM service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Retrieve the Locale ids from the server.
Dim request As New RetrieveProvisionedLanguagesRequest()
Dim response As RetrieveProvisionedLanguagesResponse = CType(Service.Execute(request), RetrieveProvisionedLanguagesResponse)

' Create a CultureInfo array representing the available languages.
Dim cultures(response.RetrieveProvisionedLanguages.Length - 1) As System.Globalization.CultureInfo

For i As Integer = 0 To response.RetrieveProvisionedLanguages.Length - 1
   cultures(i) = System.Globalization.CultureInfo.GetCultureInfo(response.RetrieveProvisionedLanguages(i))
Next i

See Also



© 2010 Microsoft Corporation. All rights reserved.