Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

returning data from multiple entities in a view

Posted on by 5

I have a dashboard that displays a set of contacts and the contacts address. This was initially designed where the Address fields were on the contact entity and all was fine. We recently made a change and moved the Address fields to a new linked entity which contacts has a 1-n relationship with. Since the fields are no longer being entered on the contact the dashboard shows them as blank. When I update the View I can add the related Addresses table and filter on it and even add columns from the Address entity, however those fields are always blank. 

I'm hoping someone can tell me if this is possible to do using a View or if there's another way to accomplish this. 

Cheers

In this example the contacts listed each have data in the county and school district fields in the Address entity but the columns are empty.

5415.crmview.jpg

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: returning data from multiple entities in a view

    Hi,

    As you mentioned that you want to display only the primary address, I agree with Goutam's suggestion above to create the lookup of your address entity on Contact entity and then display details from that. It is similar to what we have currently out of box between Account & Contacts i.e. Account can have multiple Contacts but can have one Primary Contact...

    Hope this helps. you.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: returning data from multiple entities in a view

    You can not show multiple link or related records for a parent records , this is a limitation.

    I agreed with Ravi's suggeation.The only possibility is to create a new address lookup in contact entity , which tells you which is the primary address for the contact. Once you create the lookup you need to update all the contact with filling primary address.

    So now for test go to advanced find select ProgramEnrollments entity and then under related choose contact entity . Add the contact column what you need .

    Again  under contact now you can see another address  entity with primary address. Select that and choose the address fields.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: returning data from multiple entities in a view

    You can not show multiple link or related records for a parent records , this is a limitation.

    I agreed with Ravi's suggeation.The only possibility is to create a new address lookup in contact entity , which tells you which is the primary address for the contact. Once you create the lookup you need to update all the contact with filling primary address.

    So now for test go to advanced find select ProgramEnrollments entity and then under related choose contact entity . Add the contact column what you need .

    Again  under contact now you can see another address  entity with primary address. Select that and choose the address fields.

  • dbradley Profile Picture
    dbradley 5 on at
    RE: returning data from multiple entities in a view

    Thank you for your quick response. I think I'm stuck here. I'm guessing this won't matter but I'll mention it in just in case: the results I'm looking for wouldn't have duplicates, the filter is only looking for the Address that is marked as the 'Primary' Address, so the filter should filter out duplicates. Should I expect to see the fields in that scenario?

    On your comment "however you can retrieve the data if it is a N:1 i.e. lookup of Address entity on your contact entity" I don't think I can query on the N:1 relationship between Addresses and contact because I have a second Entity (ProgramEnrollment) I am using as a filter like this:

    contact 1:N with Addresses

    contact 1:N with ProgramEnrollments

    My view is to show contacts who have enrolled in a program this month and display the contacts name and address on the dashboard. Is there not a built in way to do this ?

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: returning data from multiple entities in a view

    Hi,

    There seems to be some problem/ confusion. You cannot retrieve data from the child entity ion a view however you can retrieve the data if it is a N:1 i.e. lookup of Address entity on your contact entity.

    I think you do have a lookup of address entity on Contact entity and while creating a view you are selecting fields from that. Now cause that lookup is blank, you are getting blank values.

    Think it like this-

    Contacts

    ==========

    C1

    C2

    C3

    Contact Address

    ==============

    C1 A1

    C1 A2

    C2 A3

    C3 A4

    Now views can retrieves only unique records from the main entity(in your case it is contact). Based on the above data, you will expect results like below where C1 will be returned twice which is not supported by Views.

    =============

    C1 A1

    C1 A2

    C2 A3

    C3 A4

    Hope this helps.

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