cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

View from multiple levels of entities

Hello,
I have to collect data over more then one relationship.
Please look at this image:

AndKanPA_0-1599722635092.png

Entity01 has 1:n relationship to Entity02, and Entity02 again 1:n to Entity03

In my view of Entity01 I need value03 from Entity03.

value02 is no problem to insert in view.
But I dont see any option in view editor to get info from next relationship level.

Of course I can use fetchXML in WebTemplate ... but it's more complicated 😉

 

Thanks for help

AndKan.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: View from multiple levels of entities

Hi @AndKanPA,

This helps some of the confusion - your original statement of "Entity01 has 1:n relationship to Entity02, and Entity02 again 1:n to Entity03" should be "Entity1 has a N:1 relationship to Entity2, Entity2 has a N:1 relationship to Entity3" - 1:N indicates 1 computer has many (N) vendors.

You are typically able to reference a related record's data via a Quick View form, but you won't be able to use a Quick View inside of a Quick View. If what you gave as an example is the sole requirement, it's an easy solve:

My Setup:

  • Entity A (Entity01) has a Lookup to Entity B (Entity02) named "Entity B Ref"
  • Entity B (Entity02) has a Lookup to Entity C (Entity03) named "Entity C Ref"
  • A Quick View Form, named "Entity C Data", is created for Entity B (Entity02) includes the Lookup to Entity C (Entity03)
  • The Portal Form includes the Quick View Form mentioned in the above step
  • A View was created to show Entity A (Entity01) data with the following columns: Name, Entity B Ref, Entity C Ref (via Entity B Ref relationship)

Create a Quick View Form (Forms) on your Entity2

justinburch_0-1599851092039.png

Include the Lookup field of Entity3 in the Quick View Form
Add the Quick View Form to the Portal Form of Entity1

justinburch_1-1599851107167.png

Voila

justinburch_2-1599851119993.png

Additionally, a view of all 3 being used in lists of Entity1 records

justinburch_3-1599851134574.png

If you need to show data that is not the record name of Entity 3, we will have to consider custom approaches.

I hope this helps,

Justin

View solution in original post

6 REPLIES 6
Highlighted
Solution Supplier
Solution Supplier

Re: View from multiple levels of entities

Hi @AndKanPA,

So you need a list of value03, which you would not be able to do directly from Entity 01. If Entity1 had a 1:N to Entity 2 and Entity 2 had a N:1 to Entity3, you could do this with a subgrid of Entity 2 while Entity 2's Entity 3 related record is in the view.

You'll have to use custom Liquid or a subgrid of Entity2 records that open a modal Entity Form with a subgrid of Entity3 records.

 

I hope this helps,

Justin

Highlighted
Helper III
Helper III

Re: View from multiple levels of entities

Hello Justin,

 

a subgrid is not a resolution, because i need only one value from entity03, which is related on entity02 and from there to entity01.
Better example:
There is an entity01 with computers
Every computer has a vendor from entity02.
Every vendor has a contact in entity03.

AndKanPA_0-1599833896675.png

In a view/list of computers I want to show vendors contact phone from entity03.

 

But I'm afraid, you are right and I need a custom liquid. And build als sort and filter options by hand? 😒

 

Thank you,

AndKan.

Highlighted
Solution Supplier
Solution Supplier

Re: View from multiple levels of entities

Hi @AndKanPA,

This helps some of the confusion - your original statement of "Entity01 has 1:n relationship to Entity02, and Entity02 again 1:n to Entity03" should be "Entity1 has a N:1 relationship to Entity2, Entity2 has a N:1 relationship to Entity3" - 1:N indicates 1 computer has many (N) vendors.

You are typically able to reference a related record's data via a Quick View form, but you won't be able to use a Quick View inside of a Quick View. If what you gave as an example is the sole requirement, it's an easy solve:

My Setup:

  • Entity A (Entity01) has a Lookup to Entity B (Entity02) named "Entity B Ref"
  • Entity B (Entity02) has a Lookup to Entity C (Entity03) named "Entity C Ref"
  • A Quick View Form, named "Entity C Data", is created for Entity B (Entity02) includes the Lookup to Entity C (Entity03)
  • The Portal Form includes the Quick View Form mentioned in the above step
  • A View was created to show Entity A (Entity01) data with the following columns: Name, Entity B Ref, Entity C Ref (via Entity B Ref relationship)

Create a Quick View Form (Forms) on your Entity2

justinburch_0-1599851092039.png

Include the Lookup field of Entity3 in the Quick View Form
Add the Quick View Form to the Portal Form of Entity1

justinburch_1-1599851107167.png

Voila

justinburch_2-1599851119993.png

Additionally, a view of all 3 being used in lists of Entity1 records

justinburch_3-1599851134574.png

If you need to show data that is not the record name of Entity 3, we will have to consider custom approaches.

I hope this helps,

Justin

View solution in original post

Highlighted
Helper III
Helper III

Re: View from multiple levels of entities

Thank you very much for very very good explain and example.

Works as described 🙂

It's a funny thing, that in "entity data" only GUID of entity03 records:

AndKanPA_0-1599912832301.png

But on portal the right data (attribute name) as you described:

AndKanPA_1-1599912885524.png

AndKanPA_3-1599913009630.png


Ty Justin.

 

Best regards,

AndKan.

 

 

Highlighted
Solution Supplier
Solution Supplier

Re: View from multiple levels of entities

No worries,

I usually build with Portals for Dynamics implementations, so this is news to me but does make sense. In Dynamics, we think of the records based on their primary name, but this would be less important from a CDS/DB perspective - we would more so care about their primary key. Thanks for sharing that, now I'll know to include it in future responses.

Speaking of, if you feel I've helped resolve the issue, please consider marking the response so that it can be helpful to link for future duplicate questions.

Highlighted
Helper III
Helper III

Re: View from multiple levels of entities

Seems, that related database constructions from dynamics.
This is only a problem, if you (have to) migrate from them into dynamics.

 

My solution (for all who has migrate too 😉 was: Reduce relationship chains.

Two ways for me to reconstruct:
1) merge some data in a SQL-view and import this view into CDS.
2) create shorter tables into option sets instead of entity   

 

Thanks,

AndKan

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (5,974)