本文介绍了用于插件启动的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:
有关此内容的更多信息:
More about this here: https://crmbusiness.wordpress.com/2014/11/25/fetchxml-reports-do-not-trigger-retrievemultiple-plugins-in-crm-2011/
这篇关于用于插件启动的Dynamics CRM FetchXML报告事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!