用于插件启动的Dynamics CRM FetchXML报告事件 [英] Dynamics CRM FetchXML Report Event for Plugin to Fire On

查看:79
本文介绍了用于插件启动的Dynamics CRM FetchXML报告事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行FetchXML(甚至SQL)报告时是否会发生注册插件的事件?

Is there an event that a plugin can be registered on when a FetchXML (or even SQL) report is run?

RetrieveMultiple和Retrieve不会被触发!

RetrieveMultiple and Retrieve do not get fired!

public void Execute(IServiceProvider serviceProvider)
{
    IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
    // The FetchXML report does not fire the plugin on RetrieveMultiple
    if (context.InputParameters["Query"] is FetchExpression)
    {
        IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
        IOrganizationService service = factory.CreateOrganizationService(context.UserId);
        using (Context linq = new Context(service))
        {
            // Do the work.
        }
    }
}


推荐答案

我遇到了同样的问题,解决方法如下:

I had the same issue and the solution is the following:


报告不会触发插件。 SQL报告完全绕过CRM,而
提取报告也绕过插件管道

Reports do not trigger plugins. SQL reports bypass CRM completely, and Fetch reports also bypass the plugin pipeline

有关此内容的更多信息: https:// crmbusiness .wordpress.com / 2014/11/25 / fetchxml-reports-do-not-trigger-retrievemultiple-plugins-in-crm-2011 /

More about this here: https://crmbusiness.wordpress.com/2014/11/25/fetchxml-reports-do-not-trigger-retrievemultiple-plugins-in-crm-2011/

这篇关于用于插件启动的Dynamics CRM FetchXML报告事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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