2012-12-21 101 views
0

我试着安排服务预约,并与UserTimeZoneCode propertyAppointmentRequest type混淆。根据MSDN文章,这是int属性。如何设置AppointmentRequest.UserTimeZoneCode属性?

可惜的是,也有official sample code缺乏信息(只是幻想“幻数”):

// Create the appointment request. 
AppointmentRequest appointmentReq = new AppointmentRequest 
{ 
    ... 
    // The search window describes the time when the resouce can be scheduled. 
    // It must be set. 
    SearchWindowStart = DateTime.Now.ToUniversalTime(), 
    SearchWindowEnd = DateTime.Now.AddDays(7).ToUniversalTime(), 
    UserTimeZoneCode = 1 
}; 

所以,我在哪里可以找到这些代码匹配特定的时区?它的任何地方的枚举?

回答

2

与此SDK sample code明白了:SampleCode\CS\BusinessDataModel\BusinessManagement\WorkingWithTimeZones.cs

此示例演示如何使用各种SDK的信息与时区。

存在的时区列表可以通过GetAllTimeZonesWithDisplayNameRequest消息从系统中检索。

另外,在以前版本的SDK中遇到此枚举:TimeZoneCode Class (CrmHelpers)。 请记住,它完全不符合CRM 2011中的时区,但请注意。