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 365 | Integration, Dataverse...
Unanswered

Dynamics Views: using "OR"... Error "related entity conditions or groups cannot be grouped with the parent entity conditions or groups"

(0) ShareShare
ReportReport
Posted on by 10

Hi. I hope someone can help with this baffling problem. I would have thought this would be a common problem.

I have created a "Business Process Flow" (BPF) on entity "Lead". On creating this BPF, Dynamics creates a nice BPF entity.

I want to query this BPF entity , to find records where its related "Lead" is "Disqualified", OR its related "Opportunity" is "Lost".

So I'm looking for all records of the BPF where the Lead/Opportunity didn't make it all the way thru to "Finished" because the "Lead" was "Disqualified", or because the "Opportunity" was "Lost".

[ie I'm looking for all the ones that failed to make it thru the Process because they were disqualified or lost]. 

Should be easy, shouldn't it?!

If I try and set up the View, I get an error message "To group conditions, select two or more conditions or groups that are listed under the same entity, and then click Group And or Group Or. Individual conditions that are already grouped cannot be included in new groups, and related entity conditions or groups cannot be grouped with the parent entity conditions or groups."

pastedimage1637575285575v2.png

So clearly I need to use "FetchXML Builder" to do this.

Question is this:
How can I make this "AND" statement into an "OR"?
I want records for which the

[(Lead.statecode contains data AND Lead.statecode = 2) OR (Opportunity.statecode contains data AND Opportunity.statecode = 2)]

For love nor money I cannot get this FetchXML to do an "OR"!

I've tried everything. Is it even possible to do?

I think what makes it difficult is that Lead/Opportunity are related entities.

Any help would be hugely appreciated.

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi MikeBradley,

    It is not possible to use GROUP OR in the UI of the CRM, but you can use “Alias” + FetchXML editing using XrmToolBox to achieve it.

    You can refer following links for more details:

    FetchXML Trick – Cross Entity Criteria in a Group Filter | Work and Study book - Dynamics 365(CE) & Power Platform Blog (wordpress.com)

    Conditional groups across different linked entities in FetchXML - NETWORG Blog (thenetw.org)

    (+) FetchXML "OR" Condition using multiple link-entities - Microsoft Dynamics CRM Forum Community Forum 

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 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans