Crm 2011 outlook client - Set regarding mandatory

╄→гoц情女王★ 提交于 2019-12-12 13:39:49

问题


Our client is using Microsoft CRM 2011 outlook client and they have a unique business need. They want to make the "Set Regarding" mandatory for all of their employees using outlook to send emails (Weird huh?). If a user while sending the email forget to set regarding, outlook should display a notification message and shouldn't let the user send the email.

I have not been able to find any out of the box feature for this so I decided to write an outlook addin. Is there a way to know in outlook addin ItemSend event that the mail item has the value set for regarding field? I can get the subject of the email including CRM:xxxxx but since the email is not yet created in CRM I don't know how to pull the regarding data.


回答1:


The information about the tracking are stored in the MAPI-properties of the mail. See the attached screenshot. They should be accessible in the ItemSend event.

You could get this information like this (from @Ahmeds comment)

dynamic regardingId = mailItem.PropertyAccessor.GetProperty("schemas.microsoft.com/mapi/string/‌​;{00020329-0000-0000-C000-000000000046}/crmRegardingId/0x0000001F");




回答2:


I used following code in VS2012 and outlook 2010 to get the regarding GUID.

dynamic id = mailItem.UserProperties["crmRegardingId"]; 
if (id != null) Console.Write(id.Value); 
else Console.Write("Error");


来源:https://stackoverflow.com/questions/9836718/crm-2011-outlook-client-set-regarding-mandatory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!