Export (0) Print
Expand All
Expand Minimize

GetAllTimeZonesWithDisplayName Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online and offline

Retrieves all the time-zone definitions for the specified locale returning only the display name attribute.

The relevant classes are specified in the following table.

TypeClass
RequestGetAllTimeZonesWithDisplayNameRequest
ResponseGetAllTimeZonesWithDisplayNameResponse

Remarks

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

For a list of required privileges, see GetAllTimeZonesWithDisplayName Privileges.

Language codes are four- or five-digit Locale IDs. Valid Locale ID values can be found at Locale ID (LCID) Chart.

Example

[C#]
// 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;

// Store all time zone display names
ArrayList timeZoneDisplayNames = new ArrayList();

// Create the request
GetAllTimeZonesWithDisplayNameRequest timeZonesRequest = new GetAllTimeZonesWithDisplayNameRequest();

// Retrieve display names in US English
timeZonesRequest.LocaleId = 1033;

// Execute the request
GetAllTimeZonesWithDisplayNameResponse timeZonesResponse = (GetAllTimeZonesWithDisplayNameResponse)service.Execute(timeZonesRequest);

// Get all time zone display names
foreach (BusinessEntity businessEntity in timeZonesResponse.BusinessEntityCollection.BusinessEntities)
{
   timezonedefinition timeZone = (timezonedefinition)businessEntity;
   timeZoneDisplayNames.Add(timeZone.userinterfacename);
}
[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

' Store all time zone display names.
Dim timeZoneDisplayNames As New ArrayList()

' Create the request.
Dim timeZonesRequest As New GetAllTimeZonesWithDisplayNameRequest()

' Retrieve display names in US English.
timeZonesRequest.LocaleId = 1033

' Execute the request.
Dim timeZonesResponse As GetAllTimeZonesWithDisplayNameResponse = CType(service.Execute(timeZonesRequest), GetAllTimeZonesWithDisplayNameResponse)

' Get all time zone display names.
For Each businessEntity As BusinessEntity In timeZonesResponse.BusinessEntityCollection.BusinessEntities
   Dim timeZone As timezonedefinition = CType(businessEntity, timezonedefinition)
   timeZoneDisplayNames.Add(timeZone.userinterfacename)
Next businessEntity

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft