Create Polymorphic or multiple entity lookup field in Microsoft Dynamics 365

Power Dynamite
3 min readMay 20, 2022

--

End Result

Lookup fields were previously exclusively linked to one entity, and Customer data types pointed to either the Contact or Account entity, but there was no way to establish bespoke polymorphic lookups. Polymorphic lookup for custom fields is now available from Microsoft. We cannot create this sort of field using the user interface; instead, we must use code or the XRMToolBox Tool.

We will be using XRMToolBox for this article. To download XRMToolBox

Step 1: Connect XRMToolBox to your organization with your username and password.

Click on Connect to connect to your organization.
Click on New Connection.
Click on Connection Wizard.
Add your organization URL and click Next
Add your username and password and save your connection.
Add connection Name

Step 2: Search for Polymorphic Lookup Manager in the Tools search box and open it.

Step 3: To set parameters to create polymorphic Lookup

Select the solution
Select the Entity or Table.
This is the only option available
Give Lookup a meaningful name
This will be automatically populated but you can change
Select all the Tables or Entities which you want to search in Lookup

Finally, Click on Create Polymorphic Lookup. I have selected Account and Contact entities.

Wait for the popup.

Step 4: Go to the solution and search for the field.

Add the field to form and publish

Step 5: Let’s test it.

Add you can search both type of records

Thank you… Like and Follow

--

--

Responses (2)