Answered by:
CRM2011 - Advanced Find with N:N Relationship

Question
-
Hello - I am attempting to create an Advanced Find in CRM2011 (RU13) where an 'Account' (renamed to Entity in our system) has multiple values for a N:N relationship field called 'Area or Initiative' that has been added. We would like our users to be able to query on Accounts where they have 'Area or Initiative' of value a AND value b.
Below is the Advanced Prepared so far. The results do return the entities where value A and value B exists but it also returns entities where only value A exists.
Can anyone shed some light on what we may be doing wrong?
Have been trying to follow the guidance found on these other posts:
http://niiranen.eu/crm/2013/06/advanced-queries-with-advanced-find/
Thanks in advance!
Nick
Tuesday, January 7, 2014 2:57 PM
Answers
-
Hi,
Unfortunately this approach doesn't work for N:N relationships because the second join is only from the intersect entity rather than the 'Entity' record. This approach only works for 1:N relationships.
Hope this helps,
Scot
Scott Durow
Blog www.develop1.netFollow Me
Rockstar365
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, January 7, 2014 3:54 PM
- Marked as answer by n1k_f Tuesday, January 7, 2014 5:01 PM
Tuesday, January 7, 2014 3:54 PMAnswerer -
Your advanced find looks wrong.
What you are doing is your are searching for:
Entities that has and initiative value, which has an entity, which in turn has a value B...
This is wrong.
If you just want to find entities with either Value a or value B.. just deleted everything from the first blue row called Entities.. and then add value b to the value a, which will make it search for either value.
Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com
Tuesday, January 7, 2014 3:56 PM
All replies
-
Hi,
Unfortunately this approach doesn't work for N:N relationships because the second join is only from the intersect entity rather than the 'Entity' record. This approach only works for 1:N relationships.
Hope this helps,
Scot
Scott Durow
Blog www.develop1.netFollow Me
Rockstar365
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, January 7, 2014 3:54 PM
- Marked as answer by n1k_f Tuesday, January 7, 2014 5:01 PM
Tuesday, January 7, 2014 3:54 PMAnswerer -
Your advanced find looks wrong.
What you are doing is your are searching for:
Entities that has and initiative value, which has an entity, which in turn has a value B...
This is wrong.
If you just want to find entities with either Value a or value B.. just deleted everything from the first blue row called Entities.. and then add value b to the value a, which will make it search for either value.
Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com
Tuesday, January 7, 2014 3:56 PM -
Hello - thanks for the replies. It seems unfortunate that we can not have an advanced query function on an N:N relationship to find accounts matching both intiatives. Assuming an SSRS report is the way to go.
Thanks again!
Nick
Tuesday, January 7, 2014 5:05 PM