Mar 9, 2018

Cannot Delete Entity – Invisible Form Dependency

Once we remove all the possible dependencies for an Entity, we are allowed to Delete it in Dynamics 365. Once in a while it doesn’t behave as expected. I faced one such case recently.  Though I removed every possible/visible dependency, I couldn’t delete the Entity (say Region, new_region). It shows me some more Form dependencies.

In such case, what you need to do is create a Temporary Solution and add only the Entity that Form belongs to, Import it, Unzip and Open Customization.xml in readable editor. Now search for the Entity Schema name (i.e. new_region) you need to delete. Most probably, you will find section like below.

This means dependency is on one of the Filter of lookup fields within that Form. If you browse to the customisation of that Form you will see particular Lookup Filter is not even enable. My hunch is, previously this Lookup filter may have been configured to filter by the relationship with the entity we are going to delete. This <DependentAttributeType> tag may not have been removed once disabling the Filter of the lookup or even when deleting the relationship.

How to Fix
Enable the Lookup filter and set a different filed (ex. By Owner) and publish. Then this troublesome tag will be replaced with this new type. Now we can delete our Entity. Now you can disable the Filtered lookup as necessary.

No comments:

Post a Comment