We have a requirement to create a view that will show if a specific account is part of marketing lists associated with an entity. In the entity, there are 3 lookup fields that are configured as lookups on marketing lists. The FetchXML looks like below. What we want is for the query to look if the account is part of 1 or more marketing list in the 3 lookup fields. I added some "OR" in red below to illustrate the behaviour we are looking for.
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="new_type" operator="eq" value="100000000" />
</filter>
<link-entity name="list" from="listid" to="new_liste" alias="aa">
<link-entity name="listmember" from="listid" to="listid" visible="false" intersect="true">
<link-entity name="account" from="accountid" to="entityid" alias="ac">
<filter type="and">
<condition attribute="accountid" operator="eq" uiname="abc" uitype="account" value="{GUID}" />
</filter>
</link-entity>
</link-entity>
</link-entity>
"OR"
<link-entity name="list" from="listid" to="new_liste2" alias="ab">
<link-entity name="listmember" from="listid" to="listid" visible="false" intersect="true">
<link-entity name="account" from="accountid" to="entityid" alias="ad">
<filter type="and">
<condition attribute="accountid" operator="eq" uiname="abc" uitype="account" value="{GUID}" />
</filter>
</link-entity>
</link-entity>
</link-entity>
"OR"
<link-entity name="list" from="listid" to="new_liste3" alias="ae">
<link-entity name="listmember" from="listid" to="listid" visible="false" intersect="true">
<link-entity name="account" from="accountid" to="entityid" alias="af">
<filter type="and">
<condition attribute="accountid" operator="eq" uiname="abc" uitype="account" value="{GUID}" />
</filter>
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>
*This post is locked for comments