【发布时间】:2014-10-23 17:52:08
【问题描述】:
我在我的测试环境中遇到了提前搜索 PhoneCall 实体的问题(但在生产环境中也是如此)。我没有使用英文版,所以我将描述所有内容,而不是截图。
尝试查找所有定义了非空 ToRecipent 的 PhoneCalls。
下载 FetchXML:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="phonecall">
<attribute name="subject" />
<attribute name="statecode" />
<attribute name="prioritycode" />
<attribute name="scheduledend" />
<attribute name="regardingobjectid" />
<attribute name="rlpl_status" />
<attribute name="directioncode" />
<attribute name="phonenumber" />
<attribute name="ownerid" />
<attribute name="to" />
<order attribute="subject" descending="false" />
<link-entity name="activityparty" from="activityid" to="activityid" alias="aa">
<filter type="and">
<condition attribute="participationtypemask" operator="eq" value="2" />
<condition attribute="partyid" operator="not-null" />
</filter>
</link-entity>
</entity>
</fetch>
我可以在现场看到标准的意外错误,而不是结果。我已经运行了 CRM 2011 诊断工具来读取那里发生的事情,并在 select 语句后发现了这个异常:
Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Crm.ObjectModel.CommunicationActivityServiceBase.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context)
我在数据库上执行了相同的查询,它成功返回了结果。看起来 CRM 在加载和转换此信息方面存在问题。 我在电话实体的高级搜索中发现了与其他 2 个自定义链接实体相同的错误,但其余的看起来都很好。
还有什么... 我从 Advance Search 中删除了 ToRecipent 列,结果显示出来了,但无论我点击多少次,我都无法打开它们。
下载 FetchXML:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="phonecall">
<attribute name="subject" />
<attribute name="statecode" />
<attribute name="prioritycode" />
<attribute name="scheduledend" />
<attribute name="regardingobjectid" />
<attribute name="rlpl_status" />
<attribute name="directioncode" />
<attribute name="phonenumber" />
<attribute name="ownerid" />
<order attribute="subject" descending="false" />
<link-entity name="activityparty" from="activityid" to="activityid" alias="ab">
<filter type="and">
<condition attribute="participationtypemask" operator="eq" value="2" />
<condition attribute="partyid" operator="not-null" />
</filter>
</link-entity>
</entity>
</fetch>
我什至删除了除一个之外的所有电话呼叫,以确保它与损坏的测试数据无关。仍然出现异常。怎么了?
【问题讨论】:
标签: dynamics-crm-2011 crm