web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Query for not related to a record

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Bhavika A. Vala Profile Picture
    70 on at

    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>

    FilterContacts.png

  • Community Member Profile Picture
    on at

    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

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    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.

  • Community Member Profile Picture
    on at

    Thanks for the reply. Sorry, but could you be more descriptive as to what you mean?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans