Exporting a Dynamics 365 Solution and Displaying an Entity in the Main Menu/Ribbon
Anyone familiar with creating Dynamics solutions will be familiar with how to display that entity in the main ribbon under one of the Sales, Marketing, Settings etc areas:
If you don't plan to export your solution for consumption in other instances, it really is as simple as checking the areas you require your entity to show, saving and then publishing your solution. BUT! Things get a little bit trickier if you do plan to export and consume elsewhere. Things are even more complicated if you wish to support all current versions of Dynamics 365 (online) 8.0, 8.1 & 8.2
- Include the Site Map Client Extension
- Export a managed solution targeting version 8.0
- Unzip the downloaded solution
Solution.xmland remove all
<MissingDependency>nodes from inside
- Re-zip the solution
- Import into 8.0, 8.1 or 8.2
I've Exported my Solution and Imported Elsewhere but My Entity does not show
So the Official Advice from Microsoft is to ensure that you add the Site Map component to the Client Extensions of your solution:
If you are exporting using an 8.2 instance, exporting a version 8.2 solution and targeting an 8.2 instance, the above advice works perfectly. However, if you exporting an earlier 8.0 or 8.1 version from an 8.2 instance in order to target a 8.0 or 8.1 instance you will start getting errors when trying to import the solution:
The import of the solution FExCRM failed. The following components are missing in your system and are not included in the solution. Import the managed solutions that contain these components (FieldService (126.96.36.1992),ProjectService (188.8.131.52),SiteMapCustomization (1.8),MicrosoftDynamicsScheduling (184.108.40.206)) and then try importing this solution again.
During testing I found the following:
|#||Type||Export Version||Target Version||Export Result||Import Result||Entity Shows|
|1||Managed - No Site Map||8.2||8.2||Ok||Ok||No|
|2||Managed - Site Map||8.2||8.2||Ok||Ok||Yes|
|3||Managed - Site Map||8.2||8.1||Ok||Version Validation Failure, as expected||n/a - will not import|
|4||Managed - Site Map||8.0||8.1||Ok||Error as above (in red)||n/a - will not import|
|4||Managed - Site Map||8.1||8.1||Ok||Error as above (in red)||n/a - will not import|
|5||Managed - Site Map, Missing Dependencies removed||8.0||8.1||Ok||Ok||Yes|
|6||Managed - Site Map, Missing Dependencies removed||8.0||8.2||Ok||Ok||Yes|
NB All tests were performed exporting a managed solution from an 8.2 instance. I didn't have an 8.0 version to try importing to, hence these test cases missing.
So, tests 5 and 6....What I do mean by "Missing Dependencies removed"?
The Work Around
To resolve the import error about missing components, you will need to manually edit the
solution.xml file contained within your 8.1 or 8.0 package.
- Export managed solution targeting version 8.0
- Edit solution.xml
Now look for the
MissingDependencies node and you see something like:
<Required key="0" type="1" schemaName="msdyn_schedulingparameter" displayName="Scheduling Parameter" solution="MicrosoftDynamicsScheduling (220.127.116.11)" />
<Dependent key="1" type="62" />
<Required key="2" type="1" schemaName="msdyn_postruleconfig" displayName="Post Rule Configuration" solution="ActivityFeedsCore (18.104.22.168)" />
<Dependent key="1" type="62" />
What you need to do is remove all the inner
MissingDependency nodes so that you end up with:
- Save the file
- Re-zip the package
- Import to 8.0, 8.1 or 8.2
Normally when exporting a solution, if you have dependencies that are not included in your package, you will be asked if you want to include them and cautioned that if you don't, your solution my fail to import. You will not get this warning here because your solution does not actually depend on the new Project, Scheduling and FieldService modules/apps. The export for some reason does mark them as missing dependencies however in the produced package. I believe is does this in error and it should not be doing so. Hence, removing this incorrectly identified missing dependencies resolves the problem!
Hopefully Microsoft will address this in a future update and the above steps will no longer be necessary, but in the meantime, this work around is your friend.
Exporting an Unmanaged Solution
If you try to export a 8.0 unmanaged solution that contains the Site Map Client Extension from an 8.2 instance, you will receive the following warning:
Edited to remove the required components with higher version
The Sitemap Group Application hasn't been added to the solution because it contains components , which won't work in earlier versions of CRM.
The Sitemap SubArea nav_syncerror hasn't been added to the solution because it contains components , which won't work in earlier versions of CRM.
Despite this warning, checking the
customizations.xml in the produced package, does seem to show the Site Map as you'd expect to see it. I'm not sure if the above warning has any meaningful impact but the safest approach it to probably stick with version 8.2 for unmanaged and then when you're ready to distribute, follow the steps as mentioned in The Work Around section.