2015-09-29 55 views
1

我需要在MS Dynamics CRM 2015中創建一個視圖,該視圖爲一系列OR條件添加了一些AND條件。以下不起作用,似乎沒有其他任何東西被允許。Fetchxml(條件1或條件2)和條件3

<fetch version="1.0" output-format="xml-platform" mapping="logical" > 
    <entity name="new_crn" > 
    <attribute name="new_name" /> 
    <filter type="or" > 
     <condition value="14" operator="eq" attribute="new_totalprod" /> 
     <condition value="14" operator="lt" attribute="new_totalprod" /> 
     <condition operator="between" attribute="new_totalprod" > 
     <value>53</value> 
     <value>93</value> 
     </condition> 
     ... 
    <filter type="and"> 
     <condition operator="eq" attribute="date_sent" > 
    </filter> 
    </filter> 
    </entity> 
</fetch> 

回答

1

我能夠通過將兩個過濾器嵌入到另一個過濾器中來修改fetchxml。這做了我需要它做的事情。

<fetch version="1.0" output-format="xml-platform" mapping="logical" > 
    <entity name="new_crn" > 
    <attribute name="new_name" /> 
    <filter type="and"> 
    <filter type="or" > 
     <condition value="14" operator="eq" attribute="new_totalprod" /> 
     <condition value="14" operator="lt" attribute="new_totalprod" /> 
     <condition operator="between" attribute="new_totalprod" > 
      <value>53</value> 
      <value>93</value> 
     </condition> 
     ... 
     <filter type="and"> 
     <condition operator="eq" attribute="date_sent" > 
     </filter> 
     </filter> 
    </filter> 
    </entity> 
</fetch>