Dynamics CRM 2011 plugin in outlook only?

我与影子孤独终老i 提交于 2019-12-08 13:12:48
Henrik

I accessed CallerOrigin by reflection (it is still there, but not exposed in the SDK libraries).

The code below is a short version of my code, without any validations or null checks (i.e. not production code) just to show how it works in a few lines:

object callerOrigin = context.GetType().GetProperty("CallerOrigin").GetValue(context, null);

return callerorigin.GetType().Name; // will return "WebServiceApiOrigin" if called from outlook or web services

There are two properties on the IExecutionContext that you should be aware of when writing plugins to run offline in Outlook:

IExecutionContext.IsExecutingOffline indicates whether the plugin is running in Outlook while offline, and:

IExecutionContext.IsOfflinePlayback indicates that the plugin is being fired when changes made whilst Outlook client was offline are being played back when the client connects to the server again and sync the changes with the server.

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