官术网_书友最值得收藏!

Site map editors

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 sitemapxml property with valid XML:
siteMap["sitemapxml"] = "valid site map xml"; 
  • Update the entity using Organization Service's instance:
service.Update(siteMap); 
  • Publish the changes using the PublishXmlRequest class:
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.

It is strongly recommended that we export the existing site map XML file and save a copy of it before we start editing, which can help us to restore it back in case of any errors while editing.
主站蜘蛛池模板: 文成县| 丹凤县| 桦甸市| 沁阳市| 四子王旗| 赤壁市| 石嘴山市| 吉首市| 黄平县| 井冈山市| 新建县| 宽城| 兴和县| 西充县| 阿拉善左旗| 永泰县| 西昌市| 依安县| 房产| 鹤壁市| 新疆| 于田县| 阿瓦提县| 碌曲县| 旬邑县| 温州市| 辰溪县| 乌拉特前旗| 县级市| 天门市| 威海市| 洛宁县| 吴川市| 凭祥市| 英德市| 筠连县| 阳信县| 淳安县| 自治县| 蓬溪县| 军事|