仅在Outlook中使用Dynamics CRM 2011插件? [英] Dynamics CRM 2011 plugin in outlook only?

查看:74
本文介绍了仅在Outlook中使用Dynamics CRM 2011插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在等待第三方插件中的错误修复时,我们需要限制从Outlook朝CRM 2011自动执行的某些删除操作。是否可以在内部Dynamics CRM 2011中安装一个仅针对Outlook客户端执行的插件(不使用脱机),或者检查是否从Outlook触发了该插件的执行?

We need to restrict some delete operations done automatically from Outlook towards CRM 2011 while we wait for a bug fix in a 3rd party addin. Is it possible to have a plugin in Dynamics CRM 2011 on-premise that either only executes for the Outlook client (offline not in use) or that checks in the execution if the plugin is triggered from Outlook?

在CRM 4.0中,曾经有一个CallerOrigin属性,该属性至少提供了一些有关此信息,但是该属性现在似乎仅在CRM 2011模型中是内部的。 p>

In CRM 4.0 there used to be a CallerOrigin property that gave at least some information on this, but that property is now seemingly only internal in the CRM 2011 model.

推荐答案

我通过反射访问了 CallerOrigin (它仍然存在,但是没有暴露在SDK库中)。

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

这篇关于仅在Outlook中使用Dynamics CRM 2011插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆