How to add the Subject Tree to the Site Map for a Dynamics 365 Model Driven App

Colin Maitland, 14 May 2020

In this article I demonstrate how to add Subjects to the Site Map for a Dynamics 365 Model-Driven App.

Both Sales Literature and Subject are standard Dynamics 365 entities available for use as part of the Customer Engagement Plan and Customer Service App subscriptions. By default, Sales Literature must be associated with a Subject as shown in the following image.

image

When creating a custom Model-Driven App that includes the Sales Literature entity, it makes sense to also include the Subjects entity so that users who have permission to create and manage Sales Literature can also create and manage the Subject Tree. However, Subjects must be added to the Site Map as a Dynamic Page instead of as an Entity.

The following image shows the presence of Subjects in the Settings area of the Site Map for a custom Model-Driven App. In this custom app, Sales Literature has also been added to the Site Map and is named Events Literature instead of Sales Literature.

image

The following image shows a configuration for the Subjects sub area on the Site Map, that unlike for most other entities such as Sales Literature, does not work!

image

When the Site Map is saved and validated, the following warning message is displayed; i.e. “The Subject entity isn’t valid for the chosen client, and won’t be shown at runtime.”

image

The Clients shown in the following image are selected by default in the configuration of the Subjects sub area on the Site Map. However, this part of the configuration is not the cause.

image

The following image shows a configuration for the Subject entity that does work.

image

This image shows the app with the Settings area of the Site Map displayed. Here you can see the Subjects sub area displayed as a result of the previously demonstrated configuration.

image

However, the previously demonstrated configuration can only be applied by directly editing the Site Map as follows. Note: This approach is not a Microsoft supported approach.

1. Export the Solution.

2. Edit the “customizations.xml” contained in the exported Solution by adding the following SubArea XML to the relevant location within the Site Map XML.

image

  • Tip: Prior to exporting the Solution, you can add the Subjects sub area to the Site Map using the first configuration demonstrated in this article and then, after the Solution has been exported, locate and replace that SubArea XML with the one shown in this article.
  • Tip: Create, export, edit, import and publish a Solution that only contains the Site Map Client Extension for your Model-Driven App.
  • Note: Take care with the configuration of the VectorIcon and Icon properties! These Web Resources might not exist in your deployment! The ones shown in this article exist only if the Customer Service Hub app is installed.

3. Import the Solution.

4. Publish the Solution.

Finally, before you edit the “customizations.xml” in the exported Solution, make a backup copy of the exported solution in case your edits to the “customizations.xml” break it.