LogoLogo

Our Products

Metadata Browser

Edge Add-on

HTML To PDF Converter

Power Automate Connector

Data Mask for Dataverse

Dataverse App

Commission 365

Dynamics 365 App

AI Autocloser

Dataverse App

Flow Monitor

Power Automate App

ServicesAboutCareersBlogContact
Chat on Teams
Metadata BrowserHTML To PDF ConverterData Mask for DataverseCommission 365AI AutocloserFlow Monitor
ServicesAboutCareersBlogContactChat on Teams
HomeBlogUnderstanding and Using Polymorphic Lookups in Dynamics 365 with XrmToolBox

Understanding and Using Polymorphic Lookups in Dynamics 365 with XrmToolBox

December 16, 2024
#Dynamics 365
Harshitha Madem
Understanding and Using Polymorphic Lookups in Dynamics 365 with XrmToolBox

What are Polymorphic lookups? 

Polymorphic lookups are a type of field in Microsoft Dataverse that allow a single lookup to reference multiple tables. These lookups simplify data models by eliminating the need for multiple individual lookups for each related table and support dynamic relationships by allowing users to associate records with different types of related entities.

In this blog, we’ll explore how to set up and manage a polymorphic lookup in a Contact table using XrmToolBox. 

Scenario: Creating a Polymorphic Lookup in Contact Entity. 

Let’s consider a scenario where we want to relate a Contact with multiple types of entities, such as Expense Request, Campaign, Task. Instead of creating separate fields for each type of entity, we will configure a polymorphic lookup in the Contact table. 

Prerequisites 

  • The Dataverse environment should be set up with all the required tables.(Contact, Expense Request, Campaign, Task) 

  • XrmToolBox should be installed (https://www.xrmtoolbox.com/). 

Step 1: Connect XrmToolBox to Dynamics 365 using Microsoft Login Control. 

Open XrmToolBox and click on Connect in the top right corner. 

1

Click on New to create a new connection.

2

From the connection options, select Microsoft Login Control.

Back to all articles

More from the blog

Generate Temporary Download URLs in Dynamics 365 Using GetFileSasUrl

Enable Audio Playback in Dynamics 365 Contact Forms Using JavaScript

Email Smarter in Outlook with Sales Copilot and Power Apps Integration

Creating And Embedding a Copilot Bot in Dynamics 365

Close Case on condition using Power Automate

Connect Dynamics 365 to Console App Using Application Registration

Migrating Data from Dynamics 365 Business Central to Dynamics 365 Sales and Microsoft Dataverse

Integrating Your Copilot Agent with Teams

Need help with your business solution?

Our team can help you implement the right solution for your organization.

Get in touch
LogoLogo

Ex-Microsoft experts helping businesses get more from their Dynamics 365 and Power Platform investments.

Products

3

Click on Open Microsoft Login Control.

4

Select Office 365, check Display list of available organizations, and log in to the specific organization. 

5

Step 2: Open Polymorphic Lookups Manager. 

Click on the Tools menu in the top navigation bar. 

6

From the dropdown, select Polymorphic Lookups Manager.

7

Step 3: Select Solution, Referencing Table, Lookup Attribute, and Referenced Tables. 

Select the appropriate Solution that contains the Contact table. 

8

Choose the Referencing Table as Contact from the dropdown. 

9

For Attribute, click on Create new polymorphic lookup and provide the suitable Lookup Display Name. 

10

Select Expense Request, Campaign, and Task as the Referenced Tables. 

12

Step 4: Click on Create Polymorphic Lookup to create the new lookup field in Dataverse.

12

Step 5: Configure the Main Form in Contact Entity 

Go to the Power Apps Maker Portal and open the Main Form in the Contact entity of the respective solution. 

13

Add the Lookup Attribute that was created in XrmToolBox. In this case, the attribute name is Regarding.

14

Click on Save and Publish to save the changes.

15

Step 6: Test the Polymorphic Lookup 

Open the User Interface in Dynamics 365 and navigate to the Contact table to find the newly created Regarding lookup field. 

16

Click on the Regarding field to select a related record. 

You can now see the records of all three types of entities (Expense Request, Campaign, and Task). 

17

Click on Advanced Lookup to see the records in detail. 

18

Limitations of Polymorphic Lookups 

While polymorphic lookups are highly flexible and useful, they come with certain limitations that may affect their use in some scenarios: 

  • Performance Concerns: When dealing with large datasets, querying or filtering data across multiple entities can impact system performance. 

  • Limited Customizations: Polymorphic lookups have restricted options for custom filtering or conditional logic directly in the Power Apps Maker Portal. 

  • Unsupported in Older Tools: Some older tools or custom integrations may not fully support polymorphic lookups, creating compatibility issues.

Frequently Asked Questions (FAQs): 
1. Can I control which entities are available in a polymorphic lookup at runtime?

Yes, you can control which entities are available for selection in a polymorphic lookup field at runtime. This is typically done through JavaScript or Power Automate. By applying custom filtering logic, you can restrict the lookup options based on business rules or user roles.

2. Can I add more tables to an existing polymorphic lookup? 

Yes, you can update the lookup field’s settings in the Power Apps Maker Portal. change its answer 

3. Do polymorphic lookups support cascading actions (like delete or update)?

Yes, polymorphic lookups support cascading actions. When a related record is deleted or updated, the changes can cascade to the associated records, maintaining data integrity across related entities. 

4. Are polymorphic lookups available in all areas of Dynamics 365, such as views, reports, and dashboards?

Polymorphic lookups are available in most areas of Dynamics 365, including views, reports, and dashboards. In views, the lookup field will display the related records from multiple tables. In reports, you can pull in data from the related entities, but the complexity of the polymorphic lookup may require additional filtering or customization to ensure accurate reporting. Dashboards can also utilize polymorphic lookups, but the design may need adjustments to handle the dynamic nature of the field. 

Metadata Browser
  • HTML To PDF Converter
  • Data Mask for Dataverse
  • Commission 365
  • AI Autocloser
  • Flow Monitor
  • Services

    • D365 Marketing
    • D365 Sales
    • D365 Customer Service
    • D365 Field Service

    Company

    • About Us
    • Blog
    • Contact
    • Careers

    Copyright ©2026 Pascalcase Software Private Limited. All rights reserved.

    Privacy PolicyTerms of Service