Monday, January 9, 2012

Cannot delete components of managed solutions

With the introduction of managed solutions in CRM 2011, I have noticed that it is common in the CRM community to perceive a sense of "danger" in managed solutions. While it is true that managed solutions can give you a lot of pain in some scenarios, it is also true that some of that pain can be avoided by understanding exactly what managed solutions are about, what are their limitations and dangers. I have challenged colleagues to explain to me why they prefer to not use managed solutions and I found out that in some cases it came down to a miss-use of the managed solution concept, in some other cases it was simply fear and lack of trust for new features while in other cases they pointed out a particular disadvantage of managed solutions.

The one valid problem that most people find in managed solutions (which you don't have with unmanaged solutions) is the inability to delete solution components. Once you install a managed solution, you will never be able to delete the following components:
    • Entities
    • Attributes
    • Relationship
    • OptionSets
    • Reports
   
So what should you do if you run into that situation? In my experience, most enterprises will anyway not allow the deletion of any production data and because deleting entities/attributes will delete all the related data, this scenario is usually not allowed by the business anyway. However, if you run into this scenario and you really need to delete those components from a managed solution then you have two options:

    1. Uninstall the managed solution: You can always remove the components from the originating unmanaged solution, then uninstall the managed solution and re-install the new version of the managed solution which does not contain the unwanted components. This option can be long and tedious and will certainly delete all your data related to the solution so it is usually unacceptable to do so.
    2. Hide the unwanted components: You can always hide the components so they become invisible to the end user. For example, you can remove the entities from the sitemap, remove attributes from forms and views and hide the reports. However, these components still exist and can be visible from Advanced Find. Additionally, you can revoke privileges to all users for the entities that you are hiding.
   
   
I also hope Microsoft will in the near future remove this limitation. I would be interested to find out from other community peers if they have other specific scenarios for which managed solutions are a problem and help identify potential improvements that Microsoft should look at.

3 comments:

  1. I agree sometimes manage solution really give a pain.Cool article uh.

    ReplyDelete
  2. Any irreversible process is inherently scary for a developer. It means mistakes cannot be reversed and are a permanent flag of your mistakes. I agree that in the long term any data is probably beyond easy modification, however, just after you press the button to deploy to production is when you notice your mistake – and knowing this prevents you from pressing the button in the first place. (And choosing the unmanaged option)
    It’s not long ago people were debating whether or not to use a varchar(1) or a char(1) to save space in the database. So the thought of all these unused fields is disconcerting. (Yeah I know storage space is cheap now)
    Many developers are probably also thinking of the long term and the thought of a 15 year old database system full of unmodifiable superfluous fields and entities gives them the screaming heebies.

    ReplyDelete
  3. this link will be helpful,
    http://blogs.msdn.com/b/devkeydet/archive/2012/05/29/deleting-things-from-a-deployed-crm-2011-managed-solution-package.aspx

    ReplyDelete