How to overwrite managed solution in CRM? - dynamics-crm-2011

I exported managed solution S1 from my dev CRM. Then imported it on 'clean' TEST CRM machine. Now I made some changes on dev CRM like deleting and adding some fields from Contact entity. After, I made new export of S1 (as managed).
Now I want to update solution on TEST CRM. I choose 'Overwrite customizations'. But after update solution it is merged. Deleted fields are still present in Contact entity and new ones are added.
How to completely override imported managed solution on CRM?
Thanx

CRM Solutions can't be used to delete invidual items
Check out this blog post - it walks through some steps to overcome that limitation: Deleting things from a deployed CRM 2011 managed solution package

Installing a solution will never delete fields. Managed or Unmanaged. Overwriting Customizations will overwrite forms, views, web resources etc. But the schema will always be an accumulation of before + solution.

You don't create a solution as managed or unmanaged, you export it as unmanaged or managed. My guess would be that you exported it from dev as unmanaged the first time, therefore when you are importing it, it isn't overwriting your customizations. You can test this by attempting to remove your fields in your test environment. If you are able, then those initial changes must have been imported as a managed solution.

Related

Create managed form Dynamics CRM

I'm building managed solution and created a new form on account. This form is unmanaged and because of that this managed solution can't be deleted from end users crm. Is there a possibility to create managed form in dynamics crm?
I didn't find it in documentation and saw no property in form xml that differ my form from managed ones.
I'm using Dynamics CRM 2016 version.
When you are working on your solution in your dev environment, all components will be unmanaged. When you export your solution you are given the option of exporting as managed or unmanaged; choosing managed will result in all components in your solution being managed.
You should distribute the appropriate version based on the need. For example, to move to a new dev environment, you would import the unmanaged version; when distributing your solution to clients, use the managed version.
Any unmanaged component can be deleted from an environment, so if you are unable to delete your managed solution from an environment, it's probably because of something unrelated to the unmanaged form. If the error message you are getting specifically references the unmanaged form, you could be running into a platform bug (we've encountered quite a few when importing/upgrading/deleting managed solutions).

Dynamics CRM Goal Métric Native Subgrid

I have a customer that has removed a out of box subgrid from Goal Metric entity.
Now I just wanted to add that grid again, but how?
I have tried importing that entity from another organization but it does not overwrite the entity.
I appreciate any suggestion.
The unmanaged solutions sit on top of the managed solutions. So if you've allowed the client to change it, making a managed change will not fix it. You potentially could create a workflow with a custom action that uses the SDK to put it back, but you will not be able to change it via just a solution import

How to edit Workflow steps via API?

In my solution I have a workflow where one step contains a reference to Queue. After importing this solution on another CRM instance this workflow could not be activated because it contains an invalid reference - Queue can not be resolved. Queue with same name is created on new CRM but resolving is probably based on record Guid.
Now, I'm wondering, is there a way to edit workflow steps using CRM SDK? Whole process of CRM solution deployment is automated. And I want to remove all manual work. Some example would be great :)
Thanx in advance!
There are 2 things you can do if you are having issues with the Guids not matching in a workflow lookup when deploying from one environment to another.
Use the API to create those records referenced in the WF. When you create a record you can actually specify the Guid that it uses as the id. So write a tool or see if one exists already that will create some default data for your environment.
Use a configuration entity with references to all the EntityRefrences needed in your WFs. Then you can create a custom workflow activity to retrieve the configuration entity record (there should only ever really be one) that contains all the references in that environment.

crm 2011 making changes to a managed solution entity

we are currently working on a specific CRM development. As part of this development we are working with a different supplier who have provided us with a 'core' managed solution, a toolkit of sorts. This toolkit contains a number of entities/web resources etc but crucially contains the case and contact (renamed to customer) entities. As part of our development we need to extend these entities by adding attributes/amending form layout etc for both these entities.
should i create a new unmanaged solution - select add existing - choose the customer entity.
I can then make my changes (new attributes, form layout changes etc)
I then publish my unmanaged solution as a managed solution to import into a UAT/Prod environment.
Would this approach work ok?
What if the supplier make changes to their core entity and provide us with an updated release? what happens then or what should i do?
There are a couple of attributes (title and ethnicity) that are part of their entity but i need to work of global option sets so i have create 2 new attributes and these are displayed on the form in place of their's. I have not removed theirs but could this cause issues?
any help appreciated
chris
You are right on in the first paragraph, you would need to create a new solution and amend their entities. When you import their changes it will add on any additions to those entities. Importing customizations should never remove anything, you have to do that manually. Although unlikely, it is possible that the vendor may release a new version that requires you to roll back your customizations and reinstall it. In this instance you would need to come up with an upgrade plan and take into account all of the dependencies of the system.
I would imagine that those attributes would be dependencies of their managed solution and suspect that CRM won't let you delete them. If you are able to delete the fields and recreate them using global option sets there should be no issues so long as you use the same picklist integer values and schema names for the fields. Microsoft CRM basically copies all of the global option set values to the entity that you put them on so externally there is no difference between the standard and global option sets. Obviously a future upgrade by the vendor may force you to delete it all and recreate everything again manually (or via code using the CRM web services), but that is something you would have to take into account.
What the disadvantage here is, is if you create an entity, attribute or relationship in Dev and deploy to forward facing entity, if you then remove that entity, attribute or relationship in Dev, you must "uninstall" that solution. Of course, if you have critical data in that forward facing environment, it is gone when that solution is removed. So, if you deploy from Dev to forward facing, if in the future you no longer need that entity, attribute or relationship, although you can remove it from forms, it will always remain an artifact in your system. This is a disadvantage when working with Managed solutions.

ms crm 2011 solutions

Assuming I received a managed solution from another developer which contains an amended contact entity. How should I best make changes to that entity without affecting theirs'?
The changes would be additions as opposed removing anything they have done but ultimately for the end user I want them to see a mix of their original contact entity plus my changes. Is it best I simply create a new unmanaged solution, add their existing contact entity and make changes that way? Or do I start afresh adding in the contact entity from the system layer.
If you are working with these solutions internally in your organization you should almost always use an unmanaged solution. Managed solutions are for the most part a way to box your CRM customizations in order to sell them and protect them from being changed. If this is the case you are dealing with you can probably still amend the entity but you would have to do it in the default solution or another solution - sounds like you are already going down this track. I haven't tested importing a managed solution and changing an entity customization but this is how I would expect it to work.
Yes, the best option is to create managed solutions will which will not override the existing customizations but it will add any extra customization without affecting the existing ones.
You should use managed solutions only when you want to have the feature to install or an uninstall changed you have imported.
Only if the 'Customization' field for the amended contact entity is set to true, you can directly modify the update and include your changes there. Otherwise, you can create your own managed solution that has the contact entity modifications and import it to your system. Dynamics CRM will then merge your changes with the other ones.

Resources