My organization recently installed the Relationship Analytics feature and it's been going well for the most part until the following error appeared on the related dailyleadkpiitem tab on Lead:
"Error in retrieve multiple of msdyn_dailyleadkpiitem..Query should have a Equal operator for msdyn_leadid attribute in the condition"
Users can dismiss the message but the view (Daily kpis for lead Associated View) never actually shows anything. The message appears to be related to permissions because logging in as a system admin doesn't show the message at all but we also don't completely understand the point of having that tab for non-system admins. It's also not very clear to me why it would fail since I can find msdyn_leadid populated for Leads where I am checking for the related dailyleadkpiitems. I found two plugins that I'm assuming are what checks and populates the record in the system but I can find no documentation on it. From what I can tell, msdyn_dailyleadkipiitems is a table that's added with Relationship Analytics. It looks like it's the individual records you can access for whatever interactions are recorded on the Relationship Analytics tab of the Lead. What I don't completely understand yet is how the records are created and updated. I'm assuming it's a plugin that's doing that but I can't completely explain the query error:
Plugin: Microsoft.Crm.ActivityAnalysisDailyKpiRetrieveMultipleValidation
System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Error in retrieve multiple of msdyn_dailyleadkpiitem.Query should have a Equal operator for msdyn_leadid attribute in the condition
at Microsoft.Xrm.RemotePlugin.Grpc.SandboxFabricGrpcClient.ExecutePluginInternal(IRemotePluginRequest pluginRequest, ExecuteRequest executeRequest, Guid executionId, ISandboxFabricDuplexCommunicationHandler communicationHandler, Boolean returnTraceInfo, Guid organizationId, SandboxFabricCallTracker sandboxFabricCallTracker) +0x5d0
at Microsoft.Xrm.RemotePlugin.Grpc.SandboxFabricGrpcClient.ExecutePlugin(IRemotePluginRequest pluginRequest, IPluginExecutionContext executionContext, IPluginTracingService pluginTracingService, ISandboxFabricDuplexCommunicationHandler communicationHandler, ISet`1 earlySerializedPropertiesList, SandboxFabricCallTracker sandboxFabricCallTracker, ISandboxMemoryStreamProvider memoryStreamProvider) +0x2cd
at Microsoft.Xrm.RemotePlugin.Grpc.SandboxFabricCodeUnit.Execute(ILifetimeScope scope, IExecutionContext context, SandboxFabricCallTracker& sandboxFabricCallTracker, ISandboxMemoryStreamProvider memoryStreamProvider) +0x6e
at Castle.Proxies.Invocations.ISandboxFabricCodeUnit_Execute.InvokeMethodOnTarget() +0x13
at Castle.DynamicProxy.AbstractInvocation.Proceed() +0x2d
at Microsoft.Xrm.RemotePlugin.Client.Interceptors.SandboxFabricPluginTraceInterceptor.Intercept(IInvocation invocation, IExecutionContext context, SandboxFabricCallTracker sandboxFabricCallTracker) +0x1f