Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Subgrid To Show Records With Indirect Relationship

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!

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    RE: Subgrid To Show Records With Indirect Relationship

    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. 

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,068 Super User on at
    RE: Subgrid To Show Records With Indirect Relationship

    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
    D365 User 06 70 on at
    RE: Subgrid To Show Records With Indirect Relationship

    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.

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    RE: Subgrid To Show Records With Indirect Relationship

    a33ik

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

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    RE: Subgrid To Show Records With Indirect Relationship

    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.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,313 Super User on at
    RE: Subgrid To Show Records With Indirect Relationship

    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.

  • Steve Zhao2 Profile Picture
    Steve Zhao2 on at
    RE: Subgrid To Show Records With Indirect Relationship

    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?

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    Subgrid To Show Records With Indirect Relationship

    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!

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans