Dynamics CRM。在子网格中完全自定义FetchXml [英] Dynamics CRM. Fully custom FetchXml in subgrid
问题描述
我在帐户上制作子网格,以便按多个字段显示所有相关联系人。
这是我想要设置的获取xml:
I'm making a subgrid on account to show all related contacts by multiple fields. Here's fetch xml I'm trying to set:
<fetch mapping="logical">
<entity name="contact">
<attribute name="firstname" />
<filter type="or">
<condition attribute="new_behorde" operator="eq" value="" />
<condition attribute="new_behorde2" operator="eq" value="" />
<condition attribute="new_behorde3" operator="eq" value="" />
</filter>
</entity>
我使用document.getElementById(contacts)。control进行设置。 SetParameter方法。
但是如果我尝试运行document.getElementById(contacts)。control.refresh(),则有效获取xml变为:
I'm setting this using document.getElementById("contacts").control.SetParameter method. But if I try to run document.getElementById("contacts").control.refresh(), effective fetch xml becomes:
<fetch mapping="logical">
<entity name="contact">
<attribute name="firstname" />
<filter type="and">
<condition attribute="new_behorde" operator="eq" value="" />
<filter type="or">
<condition attribute="new_behorde" operator="eq" value="" />
<condition attribute="new_behorde2" operator="eq" value="" />
<condition attribute="new_behorde3" operator="eq" value="" />
</filter>
</filter>
</entity>
这是因为我选择了new_behorde作为子网格中的相关字段。
This happens because I chose new_behorde as related field in the subgrid.
那么我可以以某种方式避免添加这个额外的过滤器和额外条件吗?
So can I somehow avoid adding this extra filter and extra condition?
推荐答案
在表单编辑器中设置子网格,选择要返回所有记录的记录,而不仅仅是与此实体相关的记录。然后CRM将单独留下你的FetchXml。
When setting up your subgrid in the form editor, select that you want to return all records, not just the ones related to this entity. Then CRM will leave your FetchXml alone.
这篇关于Dynamics CRM。在子网格中完全自定义FetchXml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!