And how to delete these from an environment

After reading the Microsoft post about the availability (preview) of multi-table lookups (also called polymorphic lookups), I was initially a bit disappointed that this function should only be available via API and a solution for non-developers would be available at a later date.

But, once again you can rely on the Dynamics 365 CE / Power Platform Community. The official announcement wasn’t even published 24 hours when I discovered a new plugin from Tanguy while updating the XRMToolbox: the Polymorphic Lookup Creator 😀😀

XRM Toolbox Plugin – Polymorphic Lookup Creator

I tried a few different scenarios with the toolbox – multi-table lookups with 2, 3 or 4 standard tables, with custom tables or in a mixed setup with custom and standard tables. And I can say I’m impressed with what I’ve seen so far.

But here are a few things that caught my eye:

  • In the Columns view in the Maker Portal, the multi-table lookups are displayed as a normal lookup data type (no differentiation such as with Choice or Choices)
Dieses Bild hat ein leeres Alt-Attribut. Der Dateiname ist image-1-1024x63.png
aker Portal: Column
  • In the detailed view of the column, at least currently (preview) only the alphabetically first Related Table and the associated Relationship are shown

Dieses Bild hat ein leeres Alt-Attribut. Der Dateiname ist image-2.png
Maker Portal: Column Details
  • In the Relationships area, all 3 many-to-one relationships are displayed, and at least the XRMToolbox plug-in does not currently allow you to specify your own relationship names.

Dieses Bild hat ein leeres Alt-Attribut. Der Dateiname ist image-3-1024x69.png
Maker Portal: Relationships

  • On the form itself, the multi-table lookup field looks exactly like any other lookup field, and settings that can be made for lookup fields are equally available in the Maker Portal and the app

Dieses Bild hat ein leeres Alt-Attribut. Der Dateiname ist image-4-1024x300.png
Maker Portal: Form Setting
Model Driven App – Multi-Table Lookup on the form
  • The new function of the Advanced Lookups is also available with the Multi-Table Lookups
Model Driven App: Multi-Table Lookup with activated Advanced Lookup

It becomes interesting, however, when you try to remove the multi-table lookup from the environment – the following addendum.

How to delete multi-table lookups again

Some of you may not even notice that there can be problems deleting the lookup – but more on that in a moment.

The following happens in the Maker Portal, the new development environment:

  • If, for example, I select the Delete command for a multi-table lookup that refers to 3 tables, it initially seems that nothing happens after clicking on Delete Column and Save Table. The column is still displayed after the deletion has been carried out, but no error message appears either.
  • With this constellation, I can now repeat the process one more time – with the same success / failure. The column is still there after the deletion.
  • However, if I switch to the Relationships tab in between, I see that one of the relationships of the multi-column lookup has been deleted with each deletion process and after the two “unsuccessful “Attempts to delete only one relationship still exists.

Maker Portal: 3 Relationships
Maker Portal: 2 Relationships after 1. delete step
Maker Portal: 1 Relationship after the 2. delete step

  • Interestingly, the link displayed in the Colums details of the lookup also changes here. If the relationship that comes first alphabetically is always displayed, it is also deleted first when you delete it – in my example you can see the change from opportunity to quote to order (sales order).
  • If only one relationship is left is, the last, decisive deletion attempt fails and the attempt to delete the relationship directly also causes the same error message that there is a dependency
Maker Portal: error message when trying to process the 3. delete step

The solution 😀

But I didn’t want to give up that quickly. The switch to the classic editor shows very quickly – there is no problem here. The last remaining relationship or the field can be deleted in gthe classic editor without problems or error messages and after a click on Publish it is also removed from the Maker Portal.

Another test shows – all relationships are removed directly in the classic editor. So even with a multi-table lookup field with relationships to 3 other tables, I can delete this directly without having to repeat the deletion process for each relationship.

So if you are in the classic editor, you will probably not notice this behavior at all, if you are in the Maker Portal, you have hopefully found the solution here.

Classic editor: Successful delete with 3 Relationships

No responses yet

Leave a Reply

Your email address will not be published.