Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Delete issue when changing entity in a solution from 'All Assets' to just the components that have been changed

Posted on by 10

Apologies for the long winded explanation below but I'd be grateful for some suggestions to get round a problem with a solution that contains the out of the box User entity.

The solution in question has a bunch of custom entities as well as some out of the box ones.  Unfortunately in the case of the User entity it was included with 'All Assets' ticked.  Whenever it is exported this results in a whole list of warnings about missing Microsoft components.  It has worked up until now as those missing components have existed in all instances from Dev through to Production.

However, this week that changed and the solution won't install anywhere as it's missing a whole bunch of Omnichannel components required by the User entity across about 3 Microsoft solutions and these don't appear to be in any other instance, so I'm guessing something has been installed in the Dev environment that is not present in any other.

To avoid this sort of pain I thought it would make sense to remove the User entity from the main solution and only put back the main form and one new custom field as that is all that has been changed (custom entities with 'All Assets' I've seen will automatically have their relationships added back to User.  I did this in a spare instance and exported and all the export warnings magically disappeared.  However, as a precaution I thought I'd check the User entity to see if it had any unmanaged components.  This was fresh in my memory as we've recently had a 3rd party do a similar exercise to the contact and account entities where they changed their unmanaged solutions from 'All Assets' to just their own customised components.  When they pushed it to production it ended up deleting a couple of Microsoft Marketing segmentid lookups and associated relationships so they ended up having to take those two fields and relationships from another instance and put them back to production via an unmanaged solution.

When I checked the User entity in Production all looked good until I clicked on the 1:N section.  There are over 5,000 relationship where at least 70% of them are marked as unmanaged!  To my mind that means I can't possibly release the streamlined main solution as can't take the risk of deleting these relationships!  The behaviour I had observed before where Microsoft entities have unmanaged components is that if you include them in your own managed solution then the Active layer in the target instance gets removed and replaced with the managed layer of your solution.  If you then change the entity in your solution from 'All Assets' and just include the things you've changed then importing that back into the target instance results in the Microsoft component being deleted since it only has a managed layer tied to your own solution.

Clearly this would be a disaster with thousands of relationships being unmanaged so the only thought I've had is to potentially create a redundant solution just to hold the 'unmanaged' components of the User entity and then push that into the target so that they now become 'managed' and tied to the redundant solution.  At that point I'm assuming it would be safe to remove User from the main solution and put back individual components so that when importing main solution into target instance it will simply remove the main solution layer from Microsoft's formerly unmanaged relationships and just leave the redundant solution layer.  I really don't like this workaround though and what issues it might introduce when Microsoft make any changes to the relationships impacted.

Our service desk will be raising a Microsoft Support ticket to discuss the above and what can be done but I'd be interested to hear any ideas you might have.

  • Matt777 Profile Picture
    Matt777 10 on at
    RE: Delete issue when changing entity in a solution from 'All Assets' to just the components that have been changed

    I should also make clear that the solution was imported with the Upgrade option selected so that components removed from the imported solution are also deleted in the target instance.

  • Matt777 Profile Picture
    Matt777 10 on at
    RE: Delete issue when changing entity in a solution from 'All Assets' to just the components that have been changed

    Many thanks for your suggestions Rod!  We did raise a Microsoft Support ticket and it's been with them for a while now and has been passed up to the Product team.  However, in the meantime I've been doing some testing in copies of the Dev, UAT and Production instances and had good results.

    I removed the User entity from the main unmanaged solution in Dev and added it back just with the one lookup field that was customised along with the form it is placed in.  I double checked the relationships under the User entity to confirm that the other custom entities where 'All Assets' is ticked had their relationships to User automatically added in the solution.

    Exporting this solution removed the numerous warnings previously seen.  Importing it as managed into the test copies of UAT and Production was successful.  I took a look at the User entity via the Default Solution in both UAT and Prod instances and was very happy to see that the thousands of unmanaged relationships previously contained in our main solution were still present and unmanaged, so nothing was deleted despite being removed from our solution.  There was no solution layer added as a result of being included in our managed solution.

    I will look further into what happened with the UAT instance but the good news is that we can now successfully import our main solution into it.  I have since discovered that one of our contract developers has recently done a lot of testing in UAT and this involved a number of restores of the instance, so perhaps that might have caused the issue.

    I did wonder why the thousands of unmanaged User relationships didn't get deleted when we removed 'all assets' from the User entity.  I took a look at the production instance where our solution is managed and it dawned on me that these relationships are still showing as unmanaged with just an active layer.  They don't have a layer for our solution.  This is the crucial difference with the issue we had with a recent 3rd party change where they did something similar with the account and contact entities in one of their solutions.  In their case however, the Microsoft account and contact segmentid lookup fields and relationships had converted to a managed component with their own solution layer when they pushed it into production.

    In our case the numerous relationships in User had remained as unmanaged when included in our managed solution.

    My test results have been sent to the Microsoft Product team and I'm hoping they can shed some light on the two different behaviours.

    At least I know now that if the component is in our managed solution but is still showing as unmanaged and just an active layer then we are safe to remove it without fear of deletion!

  • RodRodriguez Profile Picture
    RodRodriguez on at
    RE: Delete issue when changing entity in a solution from 'All Assets' to just the components that have been changed

    Howdy!

    Your "long winded" explanation is actually really useful :)

    One of the things I would look at doing is to make sure that all the same version of the Dynamics 365 applications are the same across your environments.  I think that the dev environment got an update and that lead to the original issue of the missing dependencies.  So, take a look in your admin portal and then make sure any updates are applied to the environments that are missing them.

    As for your "holding" or "redundant" solution, that sounds like it will work.

    If you want to test it out, then spin up a new environment and make a minimal copy (just the scheme, no data) from production to the new environment and test out any changes and solution imports just to see the effect (and time) when bringing in the other solution.

    Also, another viable option is to just leave the unmanaged layer in place.  If it isn't causing an issue, then there might not be anything to "fix"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans