In this blog post I’m going to explore some the different scenarios you might encounter with the solution framework in CRM 2011. This blog post is based on the beta of CRM 2011 version was released in September 2010. This is not an introduction to solutions, but rather an advance look at some of the different scenarios that might be encountered when using the solution framework. If you are new to solutions, you might just want to bookmark this blog post until you've looked at some of the basics first. I will also be doing some more basic introduction blog post in the future as well but since I was in the middle of testing these scenarios I thought I'd share them right away.
The following establishes the solution to be used for the testing. Think of it as the 18.104.22.168 of the test product.
Created a new publisher
Created a new solution
Next I created two test entities A and B each having two string attributes.
And the journey begins by exporting the solution as a managed solution version 22.214.171.124 and importing data into a new organization has managed.
Simple Update, Add new Attribute to Entity A, change version number to 126.96.36.199.
All looks good – now we get the choice for maintain or overwrite, we will take maintain.
Import an older version, in this case 188.8.131.52 when 184.108.40.206 is installed
It knows that the version number is different but it doesn't warn you that you're about to install an older version. Essentially the best way to think about version number is metadata.
Checking the attributes all 3 are still listed even though 220.127.116.11 only had two.
Trying to import a managed version on top of the unmanaged entities.
Nope, I knew it wouldn’t work, but wanted to make sure you knew.
Creating 18.104.22.168 and removing Test Entity A – Attribute 2
In the target Org, I added the entity to workspace, added the three fields to the form, and added a test record while we were doing the other tests.
Import worked fine just like before – and the 3 attributes were still in the target organization meaning it didn’t magically remove them
Install into a new clean organization of 22.214.171.124 only ends up with the 2 attributes
This means new customers installing a solution will not see the deleted attribute.
Create 126.96.36.199 – Remove Entity B and import to organization with 188.8.131.52 already installed
All worked ok, as you can see only Entity A was processed there is no mention of entity B
Looking into the installed solution we see that it still has Entity A and B
So it seems the behavior is the same as attributes
Uninstalling a Solution – What happens to the Data and Your Customizations?
This is one to be careful with because it might not work the way you would want it to. First you see the following prompt.
In my case remember I had modified the default solution to add the fields to the form, and had created a single record of type Entity A. After this completed the site map change was gone, the entity and it’s data was gone. In some ways you can think of this no different than if you customized some other file for an installed application. Ideally, I would like the person removing to see a detailed list of data the will lose so they aren’t surprised or some other safeguards. For now though the important thing is to understand the current behavior so you aren’t surprised.
Hopefully that gives you helps explain some of the behaviors of the solution framework that is a part of CRM 2011. As you probably figured out by now solution can be either really simple or really complex depending on a particular application. They enable scenarios that we used to think weren’t possible before and it also creates scenarios that we might not fully understand yet. I'll try to do some more of these exploring the solution framework posts in the future. If you have ideas of things you'd like to see leave them in comments.