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 -

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)