Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

Two relations for sub grid

Posted on by

In Dynamics you can only select one relationship in the subgrid for one table. Is there a way to customize the subgrid with your own query?

I would like to show all related records based on two relations from one table.

Example: selected contact = ‘Peter’ has two relations to table "connections"

Result should show all records where column A =’ Peter’ or column B = ‘Peter’

 query example:

SELECT *

FROM Contact
WHERE Column A = Peter
OR Column B = Peter

  • Bassey Profile Picture
    Bassey 9 on at
    RE: Two relations for sub grid

    Hi Dy365Fan 

    The field/column - Connections (Role to Contact or Role From Contact) can be added to the view you want displayed on the subgrid.

    pastedimage1654011304807v1.png

    Let me know if this helps.

  • Dy365Fan Profile Picture
    Dy365Fan on at
    RE: Two relations for sub grid

    maybe I didn't express myself well. Again: I would like to show two relationships in one subgrid. See the screenshot.

    I would like Connections (Role From Contact) AND Connections (Role To Contact), related to contact where the subgrid is in.

    pastedimage1653990375288v2.png

  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,454 Super User 2024 Season 1 on at
    RE: Two relations for sub grid

    Go to the sub-grid. Get the view name which is used.

    Now update the filter criteria as per your requirement u will have to add OR condition in the view, Publish and check it after that.

  • Suggested answer
    Scosec Profile Picture
    Scosec 95 on at
    RE: Two relations for sub grid

    Hi,

    I think you can do this easily with the filter criteria inside the view u are using in the subgrid.

    Try using the grouped OR condition

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans