0

我尝试安排服务预约,但对AppointmentRequest 类型的UserTimeZoneCode 属性感到困惑。根据 MSDN 文章,这是属性。int

不幸的是,官方示例代码中缺少信息(只是花哨的“幻数”):

// 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
};

那么,我在哪里可以找到与特定时区匹配的代码?任何地方都有它的枚举吗?

4

1 回答 1

2

使用此SDK 示例代码得到它:SampleCode\CS\BusinessDataModel\BusinessManagement\WorkingWithTimeZones.cs

此示例展示了如何使用带有时区的各种 SDK 消息。

GetAllTimeZonesWithDisplayNameRequest可以使用消息从系统中检索已存在的时区列表。

此外,在以前版本的 SDK 中遇到此枚举:TimeZoneCode Class (CrmHelpers)。请记住,它与 CRM 2011 中的 TimeZones 完全不匹配,但请注意这一点。

于 2012-12-21T13:05:35.690 回答