是否有一個插件可以在FetchXML(甚至是SQL)報告在運行時上註冊的事件?動態CRM FetchXML報告事件插件到火
RetrieveMultiple和檢索不被解僱!
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.
}
}
}
是否火的時候,你做一個高級查找?這是註冊爲事件前還是事件後插件?你確認它設置爲同步執行嗎?你如何確認它沒有運行?你有沒有在第一行放置一個斷點,'IPluginExectionContext ...',來驗證它是否沒有被觸發? 由於沒有觸發CRM事件,因此在查詢SQL表時無法激活插件。當運行FetchXML報告時,應該觸發RetrieveMultiple事件。 – Nicknow
你試過調試過嗎? – hkhan
@Nick它會在我執行高級查找,刷新視圖或使用fetchXML查詢從控制檯應用程序執行時觸發。我已經確認在運行fetchXML報告時它沒有運行 - 通過在if之前創建一個帳戶並將Visual Studio附加到沙箱進程。報表運行時,RetrieveMultiple似乎不會觸發。 – Bvrce