Using Polymorphic Lookup Features of InRule with Dynamics 365

  • Updated

About Polymorphism

Unlike strongly typed fields, a polymorphic data model means that a single database field in Dynamics 365 can be associated with multiple types of records, functioning as a bridge between numerous tables of different designs.

A polymorphic lookup is a challenge to author logic against because the rule author will not know which of the related database fields (in InRule, which Entity) will be referenced at runtime. In order to fully accommodate a polymorphic field, an author must author logic to accommodate ALL possible entities at runtime.

Polymorphism in InRule

Until March of 2024, polymorphic lookups were UNsupported in InRule. The March 2024 release of irAuthor 5.8.1 permitted ingestion of polymorphic entities.

In irAuthor, when a polymorphic lookup is brought into a rule application through the irX ribbon bar, the entity structure generally looks like:

  • An entity for the lookup itself
  • A 1-to-1 reference to that entity from a calling entity
  • Inside the lookup entity 
    • An entity type text field which is attached to a value list, identifying the specific polymorphic reference at runtime
    • 1:1 entity references to various strongly typed entities

An Example of Polymorphism in InRule

The below screen shots show an example of how one customer implemented polymorphism in Dynamics, and how that polymorphism was reflected in InRule: 

1. The DefinedUnit entity, with an 1-to-1 entity reference (the NDASet field) to the DefinedUnitNDASetLookup entity

Defined Unit in InRule.png

2. The NDASetLookup entity that was referenced by the NDASet entity field:  

Defined Unit NDA Set Lookup in InRule.png

3. Finally the value list that is associated with the EntityType field in the DefinedUnitNDASetLookup entity. The value of this field will tell the compiled rule application at runtime which of the entities referenced under that entity will be populated with values. Polymorphic Lookup Value List.png

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.