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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Subgrid To Show Records With Indirect Relationship

(0) ShareShare
ReportReport
Posted on by 70

Hi,

I have an entity named Programs, each Program has multiple Proposals. So there is a subgrid of all the Proposals in the Program form. Each Proposal has multiple Contacts associated with the Proposal, and each Contact can be associated with multiple Proposals. So there is an N:N relationship between Proposals & Contacts. There is a subgrid of all the associated Contacts in the Proposals entity and there is a subgrid of all Proposals that each Contact is associated with in the Contact entity. There is no direct relationship between these Contacts and the entity Program, but I want to show a subgrid of all the Programs that each Contact is associated with in the Contact form. I know there is no OOB way of doing this, so what is the best possible way to achieve this? I have heard about a FetchXML method, but since I'm not really into coding, dont know much about it or how to write it. So can someone please help me? Is it the best method, or is there any other better way to achieve this?

Thanks!

I have the same question (0)
  • D365 User 06 Profile Picture
    70 on at

    Hi,

    I have an entity named Programs, each Program has multiple Proposals. So there is a subgrid of all the Proposals in the Program form. Each Proposal has multiple Contacts associated with the Proposal, and each Contact can be associated with multiple Proposals. So there is an N:N relationship between Proposals & Contacts. There is a subgrid of all the associated Contacts in the Proposals entity and there is a subgrid of all Proposals that each Contact is associated with in the Contact entity. There is no direct relationship between these Contacts and the entity Program, but I want to show a subgrid of all the Programs that each Contact is associated with in the Contact form. I know there is no OOB way of doing this, so what is the best possible way to achieve this? I have heard about a FetchXML method, but since I'm not really into coding, dont know much about it or how to write it. So can someone please help me? Is it the best method, or is there any other better way to achieve this?

    Thanks!

  • Steve Zhao2 Profile Picture
    on at

    Hi D365 User 06,

    So Program table has 1:N relationship with Proposal table. Contact table has N:N relationship with Proposal. And what you want to achieve is that show all Programs records which are associated with current contact record in the subgrid on the Contact form, right?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I wrote a post that describes 2 ways I used - butenko.pro/.../

    Unfortunately, according to your requirements, it would be required to write some JS to implement your requirement.

  • D365 User 06 Profile Picture
    70 on at

    Steve Zhao2 ,

    Thank you for your response. Yes, thats right, I want to show a subgrid of all the Programs that the current Contact is associated with.

  • D365 User 06 Profile Picture
    70 on at

    a33ik

    Thank you for your links. I will go through them and check them out.

  • D365 User 06 Profile Picture
    70 on at

    Hi a33ik ,

    I went through your JS code. In your example, you are filtering all the records including child records of an entity. I'm not very good at coding, just know the basics, so I went through your code and got a general idea about what you doing to get the result. So if I have to tweak that code to suit my situation, could you please tell me how should I go about doing it? Do you have a code that can help me achieve it? I'm sorry, I just have basic knowledge of coding that's why I'm asking for your help. Thank you.

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi D365 User 06,

    This is the 3rd or 2nd thread for a similar question. Please, correct me if I am wrong. Do one thing share your exact scenario as tried in one of the threads and support with an Entity Relationship diagram. I will try my best to sort it out for you. or it will help others.

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

  • D365 User 06 Profile Picture
    70 on at

    I dont think so, this is the first thread am making on Subgrids to show an indirect relationship. There was another thread regarding rollup which had this as one of the issues, but since subgrid wasnt the main question, that issue wasnt resolved and that thread too is still unanswered. So I wanted to create a clear topic on Subgrid and how to show indirect relationships, so that anyone who has an idea about this aspect of Subgrids can please help me out. 

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans