Search code examples
dynamics-crm

Display Parent / Child 1:N Relationship in Sub Grid


I have created a new entity called "Contracts" which has a lookup field called "Parent Contract", which refers its parent.

When I view a contract, I want to be able to display all contracts which refer to that contract as it's parent (i.e. the children).

I have created a view called "Associated Contracts" and have filtered on Related Contracts (Parent Contract).

I've added a sub-grid to the form, and set the data source to:

Records: Only Related Records
Entity: Contracts (Parent Contract)
Default View: Associated Contracts

But I get no records back! I am new to CRM, what am I doing wrong?

Edit:

Associated Contracts - Filter Criteria Associated Contracts - Filter Criteria

All contracts in are set to active.


Solution

  • If you remove the part of the filter that only shows active parents, the subgrid should work as expected. Additionally, the subgrid will show related records no matter if the parent is active or inactive, which is standard behavior.

    You can either edit your current Associated Contracts filter, or simply use one of the default views (e.g. Active Associated Contracts), depending on the columns you want to show.