Поскольку мне нужно создать запрос, в котором мне нужно добавить условие фильтра, где допустимый тип сущности может быть любым из e1, e2, e3.
Для этого я сейчас написал ниже Fetch XML:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" top="5000">
<entity name="changelog" >
<filter type="and" >
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="event" operator="eq" value="Delete" />
<filter type="or" >
<condition attribute="entitytype" operator="eq" value="email" />
<condition attribute="entitytype" operator="eq" value="fax" />
<condition attribute="entitytype" operator="eq" value="letter" />
<condition attribute="entitytype" operator="eq" value="phonecall" />
</filter>
</filter>
<order attribute="statuscode" />
<order attribute="event" />
<order attribute="createdon" />
</entity>
</fetch>
Выше запрос передает ожидаемые записи.
Но, я полагаю, для этого может быть и другой подход - с помощью оператора IN для условия типа объекта.
Для проверки этого запроса я использую XRMTool Fetch XML Tester , который выдает ошибку. Запрос выглядит следующим образом:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" top="5000">
<entity name="changelog" >
<filter type="and" >
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="event" operator="eq" value="Delete" />
<condition attribute="entitytype" operator="in" >
<value>
phonecall
</value>
<value>
email
</value>
<value>
fax
</value>
<value>
letter
</value>
</condition>
</filter>
<order attribute="statuscode" />
<order attribute="event" />
<order attribute="createdon" />
</entity>
</fetch>
Приведенный выше запрос не возвращает никаких записей в результате.
Примечание : я отформатировал это с помощью Fetch XML Кнопка Формат тестеров.
Любая помощь?