【问题标题】:How to set AppointmentRequest.UserTimeZoneCode property?如何设置 AppointmentRequest.UserTimeZoneCode 属性?
【发布时间】:2012-12-21 11:51:55
【问题描述】:

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

不幸的是,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
};

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

【问题讨论】:

    标签: sdk timezone crm microsoft-dynamics


    【解决方案1】:

    知道了这个SDK sample codeSampleCode\CS\BusinessDataModel\BusinessManagement\WorkingWithTimeZones.cs

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

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

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

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 2021-12-03
      • 1970-01-01
      • 2011-07-07
      • 2012-04-16
      • 2014-03-11
      • 2019-10-01
      • 2010-09-16
      • 1970-01-01
      相关资源
      最近更新 更多