Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Linking Two Entities

Posted on by 1,045

Hi - I've got two entities with a common field that I would like to create a working 1:N relationship between, but seem to be having trouble.  I've created the 1:N relationship and set up a subgrid pointed at entity B on a form on entity A, but I can't get anything to list from entity B in the subgrid. How does Dynamics know what to use as the key between the two entities?  I can't seem to specify that this particular field is common between the two and to use that as a reference to list records.  Or is it working as intended and I need to set up some process workflow to populate the subgrid? 

Cheers!

  • Suggested answer
    Inogic Profile Picture
    Inogic 24,031 on at
    RE: Linking Two Entities
    Hi,
    It seems you have not associated entity B record to entity A.
    When we create a 1: N relationship between entities in CRM, it creates a field of type “lookup” in background on Child entity.
    This lookup field points to the Parent entity and it will be created with the name which we specify while creating relationship as shown below:
    5102.image007.jpg
    For egg. If we create 1: N relationship between Account & Contact where Account is the parent (1) and Contact is the child (N). So now after creating relationship, a lookup field of Account (parent) will be created on Contact (child) and this lookup will point to Account (parent).
    So now in order to show the Child (Contact) record inside the Sub grid on Parent (Account) form, you will need to associate Child (Contact) to Parent (Account).
    That is nothing but lookup field on Contact (child) should have Account (parent) record selected in it. Then only that associated Contact record will be shown in the Sub grid which is on the Account form.
    Note:
    While configuring sub grid of Child (Contact) on Parent (Account), make sure to set right properties i.e. Entity selected should be the related Child entity i.e., Contact in our case and “Records” property should be set to “Only Related Record” as shown below:

    image001-_2800_2_2900_.jpg

    For more details you can find the below link:
     
    Hope that helps!
    Thanks
  • Suggested answer
    RE: Linking Two Entities

    Hi JBill,

    While configuring subgrid, make sure to set right properties.

    In datasource->records, set "only related records"

    In datasource->entity, select "entity b(fieldname)".

    Regards,

    Prakash

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans