Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Custom Sitemap Area/Group/SubArea for a managed solution?

Purpose: To add a Group with SubArea (opening a WebResource), which could be added in a managed solution. Sitemap state before installation and after uninstallation should be same.

I understand how merging in Dynamics works and that is not an issue for me

A generic sitemap inside customizations.xml would look like this

  <SiteMap>
    <SiteMap IntroducedVersion="7.0.0.0">
      <Area Id="MA" ResourceId="Area_Marketing" 
            DescriptionResourceId="Marketing_Description"
            Icon="/_imgs/marketing_24x24.gif" 
            ShowGroups="true" IntroducedVersion="7.0.0.0">
        <Group Id="Test Group" Title="Test Group" IsProfile="false">
          <SubArea Icon="$webresource:te_/assets/images/logo.png" 
                   Id="te_survey"
                   Url="WebResources/te_/index.html"                     
                   Title="Test WebResource"
                   AvailableOffline="true"
                   PassParams="false"/>
        </Group>
      </Area>
    </SiteMap>
  </SiteMap>

However, when I used this I do not see any entry in SiteMap.

I found a post that address my concern directly. It asks to use solutionaction attribute in SubArea/Group elements which let CRM merge sitemap durin installation and uninstallation for a managed solution.

Sadly this does not work in Dynamics365. I lost my whole sitemap when I tried using it.

I think this is a relatively popular scenario.

PS:

I am on Dynamics365 (v8.2), so I cannot hack into the code behind, nor would I prefer it.

I tried How do I remove Dynamics CRM sitemap customizations? , but it does not work in Dynamics365

like image 929
Nilay Vishwakarma Avatar asked May 04 '18 10:05

Nilay Vishwakarma


People also ask

How do I add a SiteMap to a solution?

Open the Solution that you would like to use to contain the sitemap. Under Components. Select Client Extensions > Add Existing > Select “Site Map” Once it's added to the solution, click on the Edit button.

What is area in SiteMap?

There are 3 parts to a sitemap: Area – e.g. Sales, Marketing, Settings etc. Group – e.g. My Work, Customers, Tools etc. Subarea – e.g. Dashboards, What's New, Accounts, Contacts etc.


1 Answers

Site Maps are typically modified in a development environment through the built-in Sitemap Designer or through external tools such as the XrmToolBox SiteMap Editor plugin. They're then exported as a managed solution which will contain only the differences to the site map. Here are steps to perform the changes you're wanting to make using the built-in Site Map Designer:

  1. Create a new solution in the development instance
  2. Add the site map to the solution
    • click on Components > Add Existing > Site Map
    • click on Site Map, then OK
  3. Double click the site map component to edit it in the Sitemap Designer
  4. Drag the Area component to the exiting menu to create a new area
  5. Drag a Group component to the newly added area to add the group to the area
  6. Drag a Subarea component to the newly added group to create the menu item for launching the web resource
  7. Edit the properties of the subarea to reference the web resource
    • set the Type to Web Resource
    • set the URL to your HTML web resource
  8. Save and publish the site map
  9. Export the solution as a managed solution
  10. Import the managed solution into the target instance to apply the site map changes
  11. Delete the managed solution in the target instance to uninstall the solution and revert the site map changes
like image 78
Alan Mervitz Avatar answered Sep 26 '22 10:09

Alan Mervitz