Hi, I know with CRM 2016 and the advanced find you cannot say show me contacts with no tasks without custom fetch XML.
I am curious though if with fetch XML you could could go a step further.
I would like to be able to say show me all contacts not on a specific static marketing list. If I use not on a marketing list it still returns contacts that are on other marketing lists, I would like to be more specific though.
Thoughts?
*This post is locked for comments
Thanks for the reply. Sorry, but could you be more descriptive as to what you mean?
You have to pass Marketing list A GUID while fetching contacts. So your fetch XML will be:
Find all contacts that are not part of marketing list A.
Hi Bhavika and thanks for your response. We are on v8 - so we don't have that functionality. But my question was actually a little deeper.
Pretend I have a contact, John Smith. John Smith is a member of Marketing List A and Marketing List B. With a query I would like to find John Smith and add him to Marketing List C if he is not a member of Marketing List A.
The query above will not do as I intend as John Smith is also on Marketing List B. So the query will show John Smith, when I want the query to exclude him as he is on Marketing List A.
Does that make sense? It may not be possible, but it feels like it should be.
Thanks,
Rob
Hello Rob,
Which CRM version are you using?
In CRM v9 we can apply condition as below. By this query, you will get all contacts which are not in any marketing list.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="contact">
<attribute name="fullname" />
<attribute name="telephone1" />
<attribute name="contactid" />
<order attribute="fullname" descending="false" />
<link-entity name="listmember" from="entityid" to="contactid" intersect="true" link-type="outer">
<link-entity name="list" from="listid" to="listid" link-type="outer" alias="ae" />
</link-entity>
<filter type="and">
<condition entityname="ae" attribute="listid" operator="null" />
</filter>
</entity>
</fetch>
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6