Virtual Entities - Relationships

In my post Virtual Entities I walked through the steps of creating a Virtual Entity using the data source "https://services.odata.org/V4/OData/OData.svc"

Another open data source is "https://api.purdue.io/odata" (publicly accessible), which lets us leverage a 1:n relationship that exists between (course-) subjects and courses in that provider to create and relate two virtual entities.

So if I create a parent (virtual) entity called CourseSubject and a related (virtual) entity called Course I can demostrate another aspect of the power of virtual entities - relationships

 

If I click CourseSubjects in the sitemap above I see all the (course-) subjects listed in a nice grid...

 

 

I can click one of the subjects, eg "American Studies" to open the form...

 

 

In the form, I can navigate to the related  views to see the all the Courses related to the subject American Studies...

 

 

In the list of courses related to subject American Studies I can click a Course...

 

 

And in the opened form I can see the lookup field from the relationship with the Subject

 

 

To make this work it is important you ensure that the external name of the lookup field matches the external name from the data source entity

 

 

The external name of the Lookup field is found in the data source xml

 

 

With Virtual Entities you can surface data from external data sources in Dynamics 365 and work with the data as entities without the data residing in Dynamics 365

Enjoy

See Also

  • Download the unmanaged solution here
  • List of Odata public APIs can be found here (filter by V4)