Short form: how do I create a relationship between two virtual entities with custom data providers that I authored so I can use them in subgrids related to each other?
I want to create a subgrid view on a contact form that displays a list from VE1 (call it personal accounts). When clicking on a personal account, I want to view the activity (VE2) related to the selected personal account on a subgrid found on the personal account form.
Where am I:
- I have two data sources, each with their own providers for one virtual entity.
- I have the relationship defined between contacts and personal accounts
- I have the contact form modified to show the personal accounts in a subgrid using the RetrieveMultiple handler for this entity. This works beautifully.
- When clicking on the personal account, the form will load with details loaded.
What's Not Working:
To me, I feel like I need this relationship to be present so that the subgrid can show associated records using the IDs from the virtual entities. Without this, the context doesn't have any concept of what record it is supposed to be associated with. How do I create a relationship between the two virtual entities so that the subgrid data shows correctly?
Thanks in advance!
It's one of the documented restrictions of virtual entities that you cannot have entities from two different providers in the same query. I assume the restriction that you can't create a relationship between two different providers is related to this. Is it possible for you to create a single provider that works for both entities?
Virtual entities are also read-only, so there should be no need to set cascading options on its relationships as you won't be able to make any changes to the records to cascade.
I found the following article that explains how to set up a Virtual Table Relationship.
Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.
Darren Lutchner - 365 Assist