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.
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.
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!
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.”
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.
The following image shows a configuration for the Subject entity that does work.
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.
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.
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.