Introduction to solutions (Developer Guide for Dynamics 365 for Customer Engagement apps)| MicrosoftDocs
Developers and authors create, package and maintain units that extend Dynamics 365 for Customer Engagement apps
Introduction to solutions
Solutions are how customizers and developers author, package, and maintain units of software that extend [!INCLUDEpn_dynamics_crm_online] apps. Customizers and developers distribute solutions so that organizations can use [!INCLUDEpn_dynamics_crm] apps to install and uninstall the business functionality defined by the solution.
Use solutions to extend the capability of [!INCLUDEpn_dynamics_crm] apps. For software that operates outside the application, use traditional methods to package and install your application, such as an installer program.
If your application consists only of [!INCLUDEpn_dynamics_crm] apps solution components, it can be imported directly into [!INCLUDEpn_crm_shortest] apps. You won’t have to create an installer program.
However, if your extensions include a combination of [!INCLUDEpn_dynamics_crm] apps solution components and external components, which are not [!INCLUDEpn_dynamics_crm] apps solution components, you’ll need an installer.
For example, you can create a [!INCLUDEpn_NET_Framework] application that manages data stored in custom [!INCLUDEpn_dynamics_crm] apps entities using the web service APIs. People who install your application may install a [!INCLUDEpn_dynamics_crm] apps solution to create the custom entities and then install your application separately by using an installer. Or, you could include the installation of the [!INCLUDEpn_dynamics_crm] apps solution into the installer you create for your application.
Solutions exported from an earlier version of [!INCLUDEpn_crm_shortest] apps can be imported into later versions as shown in the following chart.
Generally, solutions can be imported into organizations less than two versions higher than the version the solution was exported from. Service pack releases will provide the option to either export a solution with compatibility for that service pack, or just with capabilities included in the base version. [!INCLUDEproc_more_information] Maintain managed solutions: Version compatibility.
[!NOTE] For information about solutions created before [!INCLUDE pn-crm-2015] see Dynamics CRM 2016 Introduction to solutions > Version compatiblity
Solution components are created by using the customization tools or APIs included in [!INCLUDEpn_dynamics_crm] apps and are fully hosted in the application. The following diagram shows the types of solution components.
When you define a [!INCLUDEpn_crm_shortest] apps solution you create a group of solution components that can be managed together.
[!NOTE] Solutions can only add new solution components or overwrite existing solution components. Solutions can’t be used to delete solution components.
Unmanaged and managed solutions
There are two types of [!INCLUDEpn_dynamics_crm] apps solutions: managed and unmanaged. A managed solution is a completed solution that is intended to be distributed and installed. An unmanaged solution is one that is still under development or isn’t intended to be distributed. When the unmanaged solution is complete and you want to distribute it, export it and package it as a managed solution.
The following diagram introduces how managed and unmanaged solutions interact with the system solution to control application behavior.
The system solution represents the solution components defined within [!INCLUDEpn_dynamics_crm] apps. Without any managed solutions or customizations, the system solution defines the default application behavior.
Many of the components in the system solution are customizable and can be used in managed solutions or unmanaged customizations.
Managed solutions are installed on top of the system solution and can modify any customizable solution components or add more solution components.
Managed solutions can also be layered on top of other managed solutions. As long as a managed solution enables customization of its solution components, other managed solutions can be installed on top of it and modify any customizable solution components that it provides.
All customizable solution components provided by the system solution or any managed solutions can be customized in the unmanaged customizations.
Unmanaged solutions are groups of unmanaged customizations. Any unmanaged customized solution component can be associated with any number of unmanaged solutions.
You create a managed solution by exporting an unmanaged solution and selecting to package it as a managed solution.
The ultimate behavior of an instance of [!INCLUDEpn_dynamics_crm] apps for a specific organization is the culmination of the system solution, any managed solutions, and any unmanaged customizations.
When a solution is unmanaged, you can perform the following actions:
Delete components that allow for deletion.
Export and import the unmanaged solution.
Export the solution as a managed solution.
Importing unmanaged solutions
When you import an unmanaged solution, you can edit its components in the new organization.
[!IMPORTANT] When you import an unmanaged solution, the definitions of any solution components that already are in the organization will be overwritten. You can’t undo this action.
Each [!INCLUDEpn_dynamics_crm] apps organization contains customizable solution components. Together, all of these solution components are called the default solution. This is the solution you edit when you select Customize the System in the application. You can export this solution and the customizations in it in just like an unmanaged solution. However, you can’t export the default solution as a managed solution.
Create an unmanaged solution
If you don’t intend to generate a managed solution, you don’t have to create an unmanaged solution. You can customize the system directly. Organizations that just want to be able to edit, back up, and transport their customizations don’t have to use the more advanced capabilities of the [!INCLUDEpn_dynamics_crm] apps solution framework.
When you create an unmanaged solution, you create a way to group a subset of the available customizable solution components. The solution components in an unmanaged solution are references to customizable solution components in the organization.
After you create an unmanaged solution, you can add solution components to it. By using this smaller set of components you can decide to only include those solution components that are relevant to a particular functionality. This allows for a smaller size package when you export your solution and makes a more manageable set of components.
Any components you add to your unmanaged solution are included in the customizable solution components for the system. Unmanaged solution components can be added to multiple unmanaged solutions.
[!IMPORTANT] Because each unmanaged solution contains a reference to the shared group of solutions, changes you make to solution components in one solution are also applied for all unmanaged solutions that reference those solution components.
[!TIP] You can also create unmanaged solutions just to provide convenient access to specific solution components. For example, you may use lots of HTML web resources but only some of them represent top-level user interface elements in your solution. You may want to create an unmanaged solution that includes only those top-level user interface components so that you can locate and open them easily.
Solution publisher for unmanaged solutions
Each solution requires a solution publisher. For an unmanaged solution, the solution publisher provides a common customization prefix and option value prefix. [!INCLUDEproc_more_information] Create a Solution Publisher
Many solutions can be associated with a single solution publisher. Each organization will have a solution publisher called “Default Publisher for <OrganizationUniqueName>”. If you want all your unmanaged solutions to share the same customization prefix and option value prefix, we recommend that you just associate your unmanaged solutions with the default publisher for your organization.
[!NOTE] The solution publisher controls how managed solutions can be updated. When you install a managed solution, the publisher is visible but you can’t associate an unmanaged solution with it. If you intend to distribute a managed solution, see Solution Publisher for managed solutions.
Delete an unmanaged solution
If you delete an unmanaged solution, you just delete the group used to contain references to solution components. The solution components in an unmanaged solution remain in the system but they are no longer associated with the unmanaged solution you delete.
[!NOTE] If you delete a solution component in an unmanaged solution, it is deleted from the system and is no longer available from any other unmanaged solution. Use “remove” instead of “delete” if you just want to remove a solution component from an unmanaged solution.
If you intend to distribute your solution as a managed solution, export your unmanaged solution and select the Managed option in the Package Type dialog box.
[!NOTE] After you generate a managed solution, you can’t install it in the same [!INCLUDEpn_dynamics_crm] apps organization that contains the unmanaged solution used to create it. It must be installed in a different organization.
After you install a managed solution, the following applies:
You can’t add or remove solution components in a managed solution.
You can’t export a managed solution.
Deleting a managed solution uninstalls all the solution components in it.
After you install a managed solution you may be able to customize the solution components if the creator of the managed solution has configured the managed solution to enable it. You must access the customizable solution components using Customize the System instead of through the managed solution itself.
Use Managed Properties to control whether a solution component is customizable and what specific customization actions are enabled.
Solution publisher for managed solutions
When you intend to distribute managed solutions, the solution publisher record associated with your managed solution is created in each organization that installs your solution. Use the solution publisher to provide information about how people who install your solution can contact you.
The solution publisher for a managed solution is also important if you want to release an update to your managed solution. If you use the same solution publisher you can create a new managed solution with the ability to update a managed solution you previously released. [!INCLUDEproc_more_information] Maintain Managed Solutions
Using managed properties, the creator of a managed solution can control whether a solution component is customizable and which specific parts of it can be customized.
[!NOTE] Managed properties must be set in an unmanaged solution. The managed property settings are only applied after the managed solution has been packaged and installed.
The exact managed properties available depend on the type of solution component. The following screenshot shows the managed properties for a custom entity.
By default, the managed property settings assume that any kind of solution component is fully customizable. Solution developers are encouraged to enable solution components in their solutions to be customizable. However, there are situations where the definition of a solution component must be ”locked down” to avoid potential breaking changes or to make future maintenance of the solution component easier.
When two or more solutions define solution components differently, [!INCLUDEpn_dynamics_crm] apps resolve the conflict using two strategies, Merge and Top Wins. The following diagram illustrates the differences.
User interface components (command bar, ribbons, forms, and site map) are merged. This means that the solution components are re-calculated from the lowest level to the highest so that the organization’s unmanaged customizations are the last to be applied.
For all other solution components any conflict is calculated in favor of the customization that is applied last. For managed solutions this usually means that the last solution installed is applied. However, there is a special case when an update to a managed solution is installed.
Conflict resolution on the update of a managed solution
Because unmanaged customizations are considered ”above” any managed solution in terms of conflict resolution, organizations installing an update to a managed solution may not see their changes applied because of unmanaged modifications. An option exists to make sure that changes applied by an update to a managed solution are available.
When you release an update to a managed solution, the organization installing the update can select:
To preserve any customizations it has applied on top of your managed solution.
To overwrite any customizations it has applied on top of your managed solution.
Organizations installing an update to a managed solution should work with the managed solution creator to evaluate which option is best.
[!IMPORTANT] Changes to entity forms and the sitemap won’t be overwritten even when the overwrite option is selected. Refer to Merge Form Customizations and Merge Navigation (SiteMap) Customizations for guidance about managing changes. Some manual customization may be required to merge unmanaged customizations into changes included in an update to a managed solution.
The solutions framework automatically tracks dependencies for solution components. Every operation on a solution component automatically calculates any dependencies to other components in the system. The dependency information is used to maintain the integrity of the system and prevent operations that would lead to an inconsistent state.
As a result of dependency tracking, the following behaviors are enforced:
Deleting a component is prevented if another component in the system depends on it.
Exporting a solution warns the user if there are any missing components that could potentially cause failure when importing that solution in another system.
Warnings during export can be ignored if the solution developer intends that the solution is only to be installed in an organization where dependent components are expected to exist. For example, when you’re creating a solution that’s designed to be installed over a pre-installed “base” solution.
Importing a solution fails if all required components aren’t included in the solution and also don’t exist in the target system.
- Additionally, when you import a managed solution, all required components must match the package type of the solution. A component in a managed solution can only depend on another managed component.
Support for multiple languages
[!INCLUDEpn_dynamics_crm] apps natively supports multiple languages. Whenever a language pack (sometimes referred to as a ”MUI pack”) is installed, user interface elements can be displayed in a different language.
There are a number of different tactics you should apply based on the type of solution components included in your solution. [!INCLUDEproc_more_information] Create Solutions that Support Multiple Languages
Package and Distribute Extensions with Dynamics 365 for Customer Engagement apps Solutions
Microsoft Dynamics 365 for Customer Engagement patterns & principles for solution builders
Plan For Solution Development
Dependency Tracking for Solution Components
Create, Export, or Import an Unmanaged Solution
Create, Install, and Update a Managed Solution
Uninstall or Delete a solution
Create Solutions that Support Multiple Languages
Work with Solutions
Sample: Work With Solutions
Sample: Detect Solution Dependencies