在 Microsoft Dynamics CRM 2011 Outlook 客户端中同步约会时出现“未知错误”

本文可帮助你解决将约会同步到 Microsoft Dynamics CRM 2011 Outlook 客户端时出现的问题。

适用范围:Microsoft Dynamics CRM 2011
原始 KB 编号: 2797386

症状

将约会同步到 Microsoft Dynamics CRM 2011 Outlook 客户端时,会发生以下错误:

将数据同步到 Outlook 时发生未知错误。

启用客户端跟踪后,将显示以下堆栈错误:

[2012-12-17 16:30:41.530]进程:OUTLOOK |组织:721c66ca-xxxx-40d2-8857-7f9f46bec876 |线程:26 |类别:Application.Outlook |用户:00000000-0000-0000-0000-0000000000000 |级别:错误 |ReqId: |SchedulableActivityForOutlook.GenerateCrmPartyInfo ilOffset = 0x5E at SchedulableActivityForOutlook. GenerateCrmPartyInfo (String entityId, Object messageItem, IDynamicEntityForOutlook dynamicEntity) ilOffset = 0x5E threadSupport.ExecuteThreadProc (ThreadProc threadProc,IntPtr 参数) ilOffset = 0x0
Outlook 互操作期间发生异常:System.FormatException:指定的字符串不是电子邮件地址所需的格式。
at System.Net.Mail.MailAddressParser.ReadCfwsAndThrowIfIncomplete (字符串数据, Int32 index) at System.Net.Mail.MailAddressParser.ParseDomain (String data,Int32& index) at System.Net.Mail.MailAddressParser.ParseAddress (String 数据, Boolean expectMultipleAddresses、Int32& index) at System.Net.Mail.MailAddressParser.ParseAddress (String data) at System.Net.Mail.MailAddress.ctor (String address, String displayName, Encoding displayNameEncoding) at Microsoft.Crm.OutlookItemWrapper.DecodeRecipientEmailAddress (PropValue mapiEntryId, PropValue altId、PropValue emailValue、PropValue emailType、String& displayName) at Microsoft.Crm.Outlook.OutlookItemWrapper.GetOutlookRecipients (Object itemWrapper、Object messageItem) at Microsoft.Crm.Outlook.OutlookItemWrapper.GenerateCrmPartyInfo (Guid entityId,IClientOrganizationContext 上下文、Object messageItem、IDynamicEntityForOutlook dynamicEntity) at Microsoft.Crm.Application.SMWrappers.SchedulableActivityForOutlook.GenerateCrmPartyInfo (String entityId、Object messageItem、IDynamicEntityForOutlook dynamicEntity)

原因

这是由“约会”窗体中缺少“ 必需与会者 ”字段导致的。 虽然 2011 Microsoft Dynamics CRM无法从表单中删除此字段,但以前版本的 Microsoft Dynamics CRM 确实允许删除 Required Attendees 属性。 因此,此问题可能仅发生在已从 Microsoft Dynamics CRM 3.0 或 4.0 升级到 Microsoft Dynamics CRM 2011 的组织。

如果缺少字段,并且添加到约会的记录在电子邮件地址字段中没有值,则表中的 ActivityPartyBaseAddressUsed 字段将设置为 值EMAIL_ADDRESS。 由于字段不为 NULL 或填充了有效的电子邮件地址,因此 Outlook 在将约会同步到客户端时会报告未知错误。

解决方案

将“ 所需与会者” 字段添加回“约会”窗体:

  1. 导航到“设置”,依次单击“自定义”、“自定义系统”、“实体”、“约会”和“窗体”。
  2. 打开环境正在使用的“main约会”窗体。 默认情况下,这是 “信息” 窗体。
  3. 从右侧的“字段资源管理器”列表中选择“必需与会者”字段,并将其拖到所需位置的窗体中。
  4. 如果愿意,可以在选中字段时单击“ 更改属性” ,并取消选中“ 默认可见 ”选项,使字段在窗体上隐藏。
  5. 在功能区中,单击“ 保存”,然后单击“ 发布”。

将“ 必需与会者” 字段添加回 “约会” 窗体后,可以使用以下步骤查询 ORG_MSCRM 数据库以查找存在问题的任何现有约会:

  1. 打开 Microsoft SQL Server Management Studio,然后在功能区中选择“新建查询”。
  2. 从功能区中的下拉列表中选择数据库 ORG_MSCRM
  3. 在查询窗口中,键入: SELECT * FROM ActivityPartyBase WHERE AddressUsed = 'EMAIL_ADDRESS'
  4. 如果显示结果,可以通过引用 PartyIdName 列来标识受影响的记录。

可以使用以下步骤修复在上一步的结果中显示的任何记录:

  1. 打开在前面步骤中的 AddressUsed 列中显示的EMAIL_ADDRESS记录。
  2. “电子邮件 ”字段更改为临时电子邮件地址,然后单击功能区中的“ 保存 ”以保存记录。
  3. 删除刚添加到“ 电子邮件 ”字段的临时电子邮件地址,然后单击功能区中的“ 保存 ”再次保存记录。