Multi-Table Lookup/Polymorphic Lookup Field in Dynamics 365 CE

Dynamics 365 CE and Power Platform

Hi Everyone,

We all know that a lookup pointing to multiple tables was an ask from many customers. Although we have a Partylist field available on Email entity, we don’t have any control to create the same as a Custom Field.

Our voice has been heard by Microsoft and released Multi-Table Lookup in Dynamics 365. For now, creation of this lookup is allowed via C# code or Web API.

Here is the code and explanation for the same.

I have four entities named as Vehicle, Motorcycle, Trucks and Cars.

We need a lookup on Vehicle entity which hold information about all other three entities.

I did run the below code and it created a lookup on Vehicle entity where I can select the record from any of the three entities (Motorcycle, Trucks or Cars).

 OrganizationRequest orgRequest = new OrganizationRequest(); orgRequest.RequestName = "CreatePolymorphicLookupAttribute"; // specify lookup attribute details orgRequest.Parameters["Lookup"] = new…

View original post 94 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.