Skip to main content

Notifications

Dynamics 365 general forum

Middle Entity Usage

Posted on by 385

Dynamics online.

I have an entity called engagements for our customer engagements.

This has fields for customer name (lookup), engagement name, and many others.

I have a entity called Service Locations.  Many customers may have different locations we provide service at.

There are fields like customer name (lookup)

So an engagement can take place at one location or may take place at several locations.

When I created a subgrid to put on the engagement form for service locations, it gives me the option to add new or add existing.

If I click add existing, it shows all Service locations no matter what customer.

I would like to only show Service locations for the particular customer on the engagement form.

From research the community I found a couple that suggested creating a "middle entity"

https://community.dynamics.com/365/customerservice/f/dynamics-365-for-customer-service-forum/313034/filter-on-add-existing-entity-look-up-on-sub-grid

https://www.crmsoftwareblog.com/2010/05/unlocking-the-power-of-microsoft-dynamics-crm-middle-entities/

Based on those I created a new entity called Engagement Locations

With these fields:

Name (primary)

Customer (Lookup)

Engagement Name (Lookup)

Location (Lookup)

I also created or editing N:1 mappings on the Engagement Location Entity.

To Engagements - Linked Customer names and Engagement Names

To Service Locations - Linked Customer Names and Locations

I published everything

I then added a new subgrid to the new middle entity.

It only gives me the option to add new, not add existing.  And when I select add new and fill it in, when I get to the locations field, it shows me all locations, not locations only for that customer.

So I think I am doing something wrong?  Maybe created wrong relationship, or mapped wrong fields, or made wrong things required vs optional...

From my description is there anything anyone notices?  Or is there a better way? 

  • Mattw112b Profile Picture
    Mattw112b 385 on at
    RE: Middle Entity Usage

    I wont.. haven't had time to go back to yet, other fires.

    Terry

  • LuHao Profile Picture
    LuHao 40,872 on at
    RE: Middle Entity Usage

    Hi partner,

    Please don't forget to close this theme by clicking Yes to mark the verified answer.

    pastedimage1566892710940v1.png

    This will help other users quickly navigate to this theme.

    Thanks.  :)

  • Verified answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Middle Entity Usage

    Hi partner,

    In the form editor, open the set properties of this sub-grid and check if its Data Source is All Record Types.

    7343.PNG

    If so, then this is the reason for this issue.

    You should choose Only Related Records instead of All Record Types. 

    0245.PNG

    Then select the Entity. The parenthesis after the entity name is the display name of the lookup field of the 1:N relationship. You could select the correct entity based on this.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans