Dynamics CRM. Fully custom FetchXml in subgrid

房东的猫 提交于 2020-01-11 14:01:31

问题


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>

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>

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?


回答1:


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.



来源:https://stackoverflow.com/questions/36944480/dynamics-crm-fully-custom-fetchxml-in-subgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!