A Managed Solution Update That Won’t Import

Bill and Ernest Cat cuteness overload

I need a hug from Bill and Ernest after this.

Today I basically had a heart attack when an update to one of our Power Apps solutions wouldn’t import.

So, here’s what happened and the issue *I* caused. Was performing an update to one of our model-driven apps, Rita CMS.

Shameless plug: see all about it here.

Today’s update was just really simple improvements like an extra field here, a new table there. One of the features being rolled out is a distribution list capability for users — let users create their own email list. In Dataverse, there is a table called “Distribution List” and there is a many-to-many relationship to Contact.

Prior to setting that up, I had a one-to-many relationship between Distribution List and another table called Distribution List Member. This was incorrect and I deleted it. Then added my many-to-many relationship to Contact.

Saved, published all customizations, exported the managed solution. Went over to Rita and imported it and BOOM….FAIL. Initiate PANIC AND FREAK OUT.

The error was something like this:

Failed to import: ImportAsHolding no association entity relationship was found for entity relationship (some guid) and association role ordinal 1.

WHAT THE HELL DOES THAT MEAN?!

After putting my Inspector Markovich hat on, it was time to fire up XrmToolBox and FetchXML Builder and dig in (while I was still having a panic and freak out).

Ran a query on the EntityRelationship table and looked for the suspect guid in my development environment. Nothing there.

Thought about it more and ran a query on the EntityRelationship table in the production environment for the suspect guid. BINGO.


The offender: jcma_distributionlist_Contact_contact.

The name of my many-to-many relationship in the update was jcma_distributionlist_Contact_Contact. Name conflict.

I removed the many-to-many relationship entirely, published all customizations again, exported again and imported into the production environment. No errors!

Now I’ll just put the many-to-many relationship back, publish, export as a new version and import to the production environment again.

So the takeaways for everyone else (and me, obviously).

If you’re deleting a table, field, or relationship, export/import that version FIRST. Then make updates, publish, export/import to production.

– OR –

If something is getting deleted and creating something else, make sure you don’t name it the same as the thing being deleted.

Thank you for your time. I am going to go have a beer now.

Leave a Comment

Your email address will not be published. Required fields are marked *