Create Polymorphic or multiple entity lookup field in Microsoft Dynamics 365
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.
Step 2: Search for Polymorphic Lookup Manager in the Tools search box and open it.
Step 3: To set parameters to create polymorphic 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.