Create managed form Dynamics CRM - dynamics-crm-2011

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).

Related

ILMerge with CRM plugin and Sharepoint Online

I am trying to us ILMerge via nuget to merge two SharePoint assemblies in to my plugin dll. The assemblies are;
Microsoft.SharePoint.Client (v16.1)
Microsoft.SharePoint.Client.Runtime (v16.1)
They seem to successfully merge in to my single plugin dll and i can see the required classes etc if I inspect the dll with JustDecompile.
When debugging the plugin, it throws a security exception;
Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0
The code successfully steps over the creation of 'ClientContext()' which is located in the Microsoft.SharePoint.Client dll, but then fails when it reaches the 'new SharePointCredentials()' line which is held in the Microsoft.SharePoint.Client.Runtime dll.
using (var srcContext = new ClientContext(url))
{
srcContext.Credentials = new SharePointOnlineCredentials(username, securePassword);
I am stuck as to why this might be happening. It is Dynamics 365 online and SharePoint online. The credentials supplied to the constructor are correct. Any pointers would be greatly appreciated. I really don't want to have to create a web service instead of ILMerging the SharePoint dlls.
This is almost undoubtedly related to the to the method being called requiring permissions that Dynamics 365 Online does not allow. That is usually the cause of a System.Security.Permissions.SecurityPermission error in a Plugin/Workfrom running in Dynamics 365 Online.
It's been a longtime, but if memory serves me correctly the SharePoint client libraries do not work in Dynamics 365 sandbox plugins (and all online plugins are in the sandbox.)
Unless you can find a way to make the calls without the libraries, using the SharePoint REST API, you'll have to either create a web service or (in my opinion the preferable if possible solution is to) use Azure Service Bus to handle the execution.
As Nick says, unfortunatelly Sharepoint.client.dll will throw you a “System.Security.SecurityException: That assembly does not allow partially trusted callers” error even if you use ILMerge to deploy it.
It is a limitation from Sandbox and there is nothing we can do until Microsoft deals with this.
But for the time being, the best way is to do oldschool httprequests as explained here: https://code.msdn.microsoft.com/SharePoint-Integration-c5f21604
Good Luck!

Importing Solution from Dynamic CRM Online Trial to Dynamic CRM On-Premise, activity feed issue

I sign up for Dynamic CRM online trial (30 days) and create an unmanaged custom solution (new fields, some custom entities, etc). Now, I want to export the unmanaged solution and import it to my Dynamic CRM On-Premise 2011 in my server (already get the latest rollup).
However, the solution is failed to be imported. The error message said that:
Import of solution * failed. The following components are missing
in your system and are not included in the solution...
There are two missing components shown. Both are web resource type, with name/Id: msdyn_/ActivityFeeds.Form.Js and msdyn_/RecordWall.htm and both are ActivityFeedsCore (1.0.5.3403) managed solution.
From what I've researched, (please correct me if I'm wrong), the problem is on the Dynamic CRM online Activity Feeds managed solution are already installed and in the Dynamic CRM on-premise, it isn't.
What should I do to be able to import the unmanaged solution without importing the Activity Feeds managed solution?
You need to use solutiondownlevelutility.exe included in the latest CRM 2011 SDK.
You can find a guide on MSDN:
http://msdn.microsoft.com/en-us/library/jj945276.aspx
Another option would be to:
- Import the Activity Feeds.
- Import your unmanaged solution.
- Delete the Activity Feeds.
You can find the activity feeds solution here : http://pinpoint.microsoft.com/en-gb/applications/microsoft-dynamics-crm-activity-feeds-12884926310
Thanks,
Mario

How to overwrite managed solution in CRM?

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.

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