A site map can be defined as a set of links through which a user can navigate and find their way around the website. In Dynamics 365 and in its earlier version, a site map is an XML file that is used for defining the navigation of the application or specific app module for the users. Until CRM 2016, there had been only one site map file for an organization. With the advent of apps in Dynamics 365, now we have one site map file for each of the app modules. As far as customizing the site map was concerned, until now we had to either update it using XML Editor, a text editor or some third-party tools. However, with Microsoft Dynamics 365 we have the built-in Site Map Designer in the product itself. This designer allows the administrator, customizers, or users with appropriate privileges to easily define navigation for an app by simply adding, dragging, and dropping the components within the Site Map Designer canvas. In this chapter, we will be covering the following points:
- Overview of the site map in Dynamics 365
- Understanding the designer interface and its components—areas, group, and sub areas
- Common operations that can be performed on the site map
For every app that is configured, we will have a separate site map defined for it. By default, we will have a Dynamics 365 custom app configured during the set up of the Dynamics 365. We can also have other apps configured while provisioning the Dynamics 365 instance such as
Project service automation, or
Customer service, if we have opted for them while provisioning Dynamics 365. For now, let's try to understand the basics of using the Site Map Designer using Dynamics 365 for a Sales app. Suppose we have selected
Sales while provisioning Microsoft Dynamics 365, shown as follows:
The link for the Dynamics 365 Trial with Enterprise Plan 1 can be found here: https://signup.microsoft.com/Signup?OfferId=bd569279-37f5-4f5c-99d0-425873bb9a4b&dl=DYN365_ENTERPRISE_PLAN1.
Now, as we have covered the basics of site map, let us look at the Site Map Designer interface and what components it has and how we can use it to update our site map for sales.
To access the Site Map Designer for our Sales app, perform the following steps:
- Log in to the Dynamics 365 Sales app with a user having System Customizer, System Administrator, or any appropriate security role to customize the site map.
- Go to
- Create a new solution with the appropriate details. For example, we have created a solution with the name of Site Map Solution, the publisher as default publisher, and the version as 184.108.40.206.
We can also log in to the default Dynamics 365 - custom app and create a new solution and add the Sales App Site Map in it.
- Click on
Client Extensionsand add
Sales App Site Mapin it, shown as follows:
We can go to
Customizations and update the site map in the default solution as well. However, as a best practice, we should create a separate solution and add the required components that need to be customized in it.
Double-clicking on it will open the
Sales App Site Map on the Site Map Designer for us to edit. The Site Map Designer canvas allows us to work with
Within the designer canvas, we can
Add, Cut, Copy, Paste, Clone, and
Let us look at these components in detail.
Area: Area can be defined as the main node or area inside the navigation pane that consists of groups and their corresponding subarea. A new area can be added or the existing area can be updated or deleted. If an area doesn't consist of any visible subarea, the area will be hidden.
Group: Groups can be defined as a collection or group of subareas. Just like an area, a new group can be added or an existing group can be updated or deleted.
Subarea: A subarea can be defined as a navigation link within the area that defines what should load inside CRM's main pane when clicked. The subarea can point to a dashboard, an entity, a URL, or a web resource. Just like area and group, a new subarea can be added and an existing subarea can be updated or deleted.
Referring to our Sales app interface:
Trainingare termed as areas
Toolsare groups within the Sales area
What's New, and
Activitiesare subareas inside the
My Work group.
The Sales area would have subareas specific to Sales, arranged inside what are termed as groups. Similarly, the Marketing, Settings and Training Area will have corresponding subareas inside the corresponding group. As shown in the following screenshot, the
Marketing Area has
Campaigns, and so on. It also has subareas specific to the marketing module. These subareas are arranged inside the
Now, as we have got the overview of the site map components, let us look at the different properties of each of these components in the next section.
- The area component comprises of following properties:
- Group component shares most of the same properties as Area:
Set as Profile property of Group might not be relevant for Dynamics 365, as the Workplace area has been discontinued starting CRM 2013.
Subarea has few more properties compared to Area and Group:
- As we know that the site map is basically an XML file, any changes that we are doing through Site Map Designer are basically updating the site map's XML behind the scenes:
- To get the Sales App Site Map definition, export the solution containing the Sales App Site Map client extension and unzip it. Then, open the
customizations.xmlfile and search for the
- The following is the sample XML for the My Work group of the Sales area inside the Sales App Site Map. We can see the
SubAreatags along with their corresponding attributes:
- As mentioned earlier, instead of using the Site Map Designer, we can manually update the site map's XML using any text editor, and can import back the solution (and publish it) to see the changes.
Site map XML reference : https://msdn.microsoft.com/en-us/library/gg334430.aspx.
In this section, we looked at the properties of the area, group, and subarea components of Site Map Designer. In the next section, we will learn how to perform some basic operations such as updating, adding, deleting, and so on, on these components through Site Map Designer.
To edit an existing area, group, and subarea in the site map, we need to select that component in the designer and go to the
properties tab of that component. Let us take a simple example to understand this. Suppose we want to rename the existing
Training area to Help, we need to select the
Training area on the site map, go to its
Properties tab, and update its
Let us specify
Help as the value for the
Title property. This updates the area's title from Training to
Help, as shown as follows:
We can also update the title property of the site map components through inline editing. For this, hover over the component to reveal the pencil. We can click on the pencil icon to edit the
Title. Similarly, we can edit or update the corresponding properties of the group and subarea components, and as we mentioned earlier, any changes made in the designer will reflect back in the XML for the site map.
To add an area, group, or subarea to the site map, we need to click on the
Add button on the Action Bar in the
Sitemap Designer. Let's add an area here to understand this. Click on the
Add button and select
Or, drag-and-drop the Area from the
Once added, we need to select the component (Area here), and then edit its properties in the
Properties tab. For example, the
Properties tab for the new Area component added is shown in the following image:
This will add a new Area named
New Area in the site map.
Similarly, we can add or drag and drop new groups and subarea components in the Navigation and specify their properties.
Through Site Map Designer, we can also cut, copy, and paste site map components. Let's select our
New Area and click on the
Cut button on the Action Bar to cut the component. The component will be grayed out.
Similarly, we can select the component and click on the
Copy button to copy the component. The
Paste button gives us the option of pasting the component to the right or left in case of Area and Group components, shown as follows:
To clone or make a copy of an existing Area, Group, and Subarea to the site map, we can select the component and click the
Clone button on the Action Bar in the
Sitemap Designer. The clone will add the respective component to the next component being cloned with the -Copy suffix added to its Title. For example, cloning the
Sales Area, as shown in the following image, will add a new area named
Sales-Copy next to the
Sales Area that is cloned:
Deleting an Area will also delete the Group and Subarea in it. Similarly, deleting the Group will delete the Subarea in it.
For example, we can move the
Sales Area to be the last Area in the site map,
My Work to be the second group within the
Dashboard as the last Subarea inside the
Work Group, and so on, shown as follows:
We can also move a Subarea to a different Group. For example, the
Dashboards Subarea can be moved to any of the other Groups such as
Collateral, and so on, and a Group to be part of a different Area. That is, we can move the
My Work Group to be part of the
To reflect any of the preceding changes for the users, such as add, clone, delete, and so on, we need to click
Save and then
Publish it in the Site Map Designer canvas. Here,
*Draft indicates that there are unsaved changes:
On saving the changes and clicking on
Publish, it changes to
Published to indicate that changes have been applied and are available for the users to see:
Clicking on the
Save button will also validate and show up if there are any errors in the site map. For example, if we have not provided values for any of the required fields or specified unallowed characters for any of the properties. In the following screenshot, we have not provided a value for the entity property in the Subarea and clicked on
Save, which is a mandatory field:
This shows the
ERROR MESSAGE notification in the designer with all the details. We will only be able to save and then publish the changes after fixing the error.
Let's take a simple scenario here to understand how we can add a new Subarea component. We realize that our Sales app users would be frequently accessing the Open Leads View inside CRM, so it would be helpful for them if we could add a Subarea for Open Leads View in the My Work Group in the Sales Area for them. To implement it, we will need to add a new Subarea inside the My Work Group of type URL. To do so, we need to click on
Add in the Action bar in
Sitemap Designer and add a new Subarea and drag and place it below the Activities SubArea in the My Work Group:
Here, the URL pattern for the view needs to be the following:
=/_root/homepage.aspx?etc=<entity code >&viewid=%7b<GUID value of view id>%7d"
viewid query parameters, we need to go to the
Open Leads view in CRM and click on the
EMAIL A LINK|
Of Current View ribbon button to get the link:
The link will have the value of
viewid. We will then copy the value of the
viewid query string parameters from the link. We can then set the properties for our new
SUB AREA, shown as follows:
We will save and then publish it. After publishing, inside the Sales app the user will be able to see the new Subarea named
Clicking on the
Open Leads Subarea will open the
Open Leads view, shown as follows:
As we saw earlier, the Subarea component has a privilege property. It defines whether to show or hide the Subarea based on privileges the user has through the security roles assigned. Let us try to understand this with an example as well. Suppose we want to show the Open Leads Subarea we just added to only those users who have a Create privilege on the Lead entity. To define this, let us go back to the
Properties tab of the Open Leads Subarea in Site Map Designer. There, we need to go to
Privileges inside the
Advanced section. Inside the Entity drop-down, we can select the Lead entity and click on the
+ (plus) button to add the record. We will leave all the checkboxes unchecked, except
Save and publish the changes. Now, let us log in with the user that has only the Salesperson security role assigned. Here, we have updated the security role and have set
Create Privilege on
Lead Entity; that is, the first option that we see in the following screenshot:
The users who do not have the Create privilege on the Lead record, will not be able to see the Open Leads Subarea in their site map.
As we saw earlier, the Subarea component has a Parameter Passing checkbox property. It specifies whether to pass information about the organization and language context to the URL. The property is only available for Subareas of type web resource or URL. Suppose we have the following URL defined in our URL property of Subarea:
http://mydomain/mypage.aspx.Checking the Parameter Passing checkbox will pass the following parameters to it:
orglcid: language code identifier of the base language of the organization
orgname: unique name of the organization
userlcid: language code identifier used by the current user
This information could be used to create solutions that support multiple languages.
Creating solutions that support multiple languages is detailed at https://msdn.microsoft.com/en-us/library/hh670609.aspx#Anchor_0.
Let us look briefly at separate ways of editing the site map apart from Site Map designer and the ways in which clients are supported for the different type of site map that we now have in Dynamics 365.
A site map, as we essentially know, is an XML file. Any XML text editor is good enough to edit site map XML files. For this, we can export the unmanaged solution that contains the site map XML, edit it either in NotePad, Visual Studio, or any other XML editor, and import it back. The important thing to remember here is, if we are importing the site map as a managed solution, it will create a new site map record with all the latest changes, and in the case of unmanaged, the existing site map XML is overwritten.
Editing the site map XML with schema validation is detailed at https://msdn.microsoft.com/en-us/library/gg334493(v=crm.8).aspx.
Apart from Site Map Designer, we can use one of the third-party site map editors to edit the site map. One of the most popular tools is site map editor that is included as part of the XRM Tool Box. This is how our Sales App Site Map loads up inside site map editor:
The tool makes it easy to edit the site map compared to editing the XML manually. The tool has been one of the most popular tools for editing site maps and has been available since CRM 2011. The tool has been recently updated to support multiple site maps available in Dynamics 365. The other option is programmatically updating the site map. For this, we can make use of the site map entity and update its
sitemapxml property, shown as follows:
- Create an object of the site map entity:
Entity siteMap = new Entity["sitemap"];
- Update its
sitemapxmlproperty with valid XML:
siteMap["sitemapxml"] = "valid site map xml";
- Update the entity using Organization Service's instance:
- Publish the changes using the
PublishXmlRequest request = new PublishXmlRequest(); request.ParameterXml = "<importexportxml><sitemaps><sitemap></sitemap></sitemaps></importexportxml>"; service.Execute(request);
We can also create and delete app-specific site map records programmatically. However, it is recommended you use Site Map Designer instead of doing it programmatically. Another point to note is that the default site map record cannot be created or deleted.
The default site map, which is the site map for Dynamics 365 – custom app is supported for both Dynamics 365 web applications and Dynamics 365 for Outlook. The site maps for any new custom apps, or the business apps such as Sales, Customer Service, Field Service, and Project Service Automation, are only supported by Dynamics 365 web applications.
In this chapter, we saw how the site map has evolved in Dynamics 365. Now, we can have multiple site maps per app and the built-in Site Map Designer tool in the product itself. We also had a detailed look at the new Site Map Designer and some common operations that can be performed through it. In the next chapter, we will cover the new Visual Process Designer and how it can be used to create business process flows with intuitive drag and drop capabilities.