Advanced Find: the relationship you are adding already exists in the query

By | July 15, 2020

I was looking at this post by CRM Ninja, and it hit me that, even though that post had a different purpose, it had an interesting workaround for the “one relationship only” problem which happens when trying to add the same relationship more than once to the query. For example, on the screenshot below, I just tried adding Tasks one more time:

image

Why would I wanted to do it? What I wanted to find all contacts where there are both “Important” and “Not important” tasks? Such as this one below:

image

If I used “or” condition on the linked task, that would give me contacts with both or one of those tasks. But I need “both”.

If I used “and”, it would not work, apparently, since none of the tasks can be important and not important at the same time.

However, I can do it this way to get the contacts I want:

image

Basically, the first condition would limit my contacts to those which have “Important” tasks. But, from there, I’d go back to the contacts(and that would be the same contact, since it’s just going back through the same relationship)… then again to the tasks… to make sure there are, also, “not important” tasks.

It may feel somewhat convoluted with this kind of looping through the relationships, but it does the trick.

Thank you CRM NinjaSmile


Leave a Reply

Your email address will not be published. Required fields are marked *