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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Filter N:N related records in advanced find

(0) ShareShare
ReportReport
Posted on by

Hi,

I got an interesting issue regarding advance find against the N:N related records. I have custom entity having only its primary attribute Name, related to Contacts in N:N manner. This entity is used for categorization of contacts and have its subgrid on contacts form.

I want to get only such contacts having category C1 but shouldn't be having category C2. So created a query as below -

Query2.jpg

But this query returns contacts having category C2 also since its N:N and intersect table must be having 2 records of same contact, one with C1 and other with relation C2. As the first condition satisfies so such contact comes in advanced find result. The second clause of  'Does not equal' doesn't work in this case.

I tried to do it this way - getting the contact results for C1 and then again filtering this data set to not to have C2 but it gave sql timeout exception, it goes in cyclic loop I guess.

Note: I need this query to add contacts in marketing list through Manage members so OOTB way is preferred instead of any coding.

Any help is highly appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    This is indeed a limitation of advanced find and a very highly up voted item in Microsoft connect. The work around is to add all items with C2 to a marketing list and then remove those that have C2. Jukka talks about this in his excellent post on the subject -niiranen.eu/.../advanced-queries-with-advanced-find

    Hope this helps

  • Community Member Profile Picture
    on at

    Thanks Scott. Nice to know its crm limitation, by the time your suggestion solves the purpose.

    Thanks again.

    Sanchita

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans