Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Fetch recursive relationship

Posted on by 105

Hi all,

I need to get all Opportunities that are linked to accounts that match my criteria for accounts (for simplicity sake, lets say I want all active accounts) AND all opportunities that are also linked to all of the accounts that have hierarchical relationship to the account the opportunity is directly linked to.

For example, if I have an Account A and it's a parent to 3 other accounts (B,C,D), I want to fetch all Opportunities where Account A is the Client and all of the opportunities where Accounts B,C,D are also Clients. 

Anyone knows how to achieve this? 

TIA,

-TS.

*This post is locked for comments

  • Tony Suslovich Profile Picture
    Tony Suslovich 105 on at
    RE: Fetch recursive relationship

    Thanks for your suggestion. Unfortunately this doesn't solve my issue. They have value = '{0}' and it's referring to an input parameter from what I understand. My issue is I don't have a specific GUID, I have a bunch of then and I need to fetch everything in 1 query.

  • RE: Fetch recursive relationship

    May be this can help designing your fetchxml  for v9.1- docs.microsoft.com/.../query-hierarchical-data

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans