Polymorphic Relationships

Polymorphic Relationships

Polymorphic Relationships, also known as multi-table lookups, universal lookups, global lookups, or entity-agnostic lookups, allow a single lookup field to reference tables of multiple types. Some system fields exhibit polymorphic behavior, such customer, which can reference either an account or a contact, and regarding on activities, which can reference any entity enabled for activities. As of 2021 Relase Wave 1, MSFT officially released custom polymorphic relationships to general availability.

The Problem

There are still a few UI kinks. First, the maker portal does not offer a way to create or edit them, Second, although their values can be set via code, just as any other relationship, in some cases, the lookup control unexpectedly allows users to interact with only one entity.

The Helpful Bits

How do I Create a Polymorphic Relationship? While you can certainly create and update polymorphic lookups via the API, there is an XRM Toolbox Tool, called the polymorphic lookup manager.  Give it a spin.

Why Does Only One Entity Show in My Multi-Table Lookup? If you can’t get the model driven app control to show all of your selected entities, or it suddenly stops working, be aware that currently, if the relationship includes any entities enabled in your app, all of the entities for which it is enabled must also be included in your app. There are a few other requirements. Please see this MSFT support article.

Conclusion

Polymorphic lookups are very powerful. Hopefully the kinks will be worked out soon. Special thanks to Tanguy Touzard for building this invaluable tool and Daryl Labar for helping me pin down this gotcha.

Resources

The Helpful Bit Binary

Leave a Reply

Your email address will not be published.