Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

By | September 18, 2019

Introduction

In this blog, we’ll see how to use Relative URLs in Dynamics 365 CRM Classic Web, and Dynamics 365 CRM Unified Interface, and the difference between the two while opening a Relative URL.

There are some entities in Dynamics 365 CRM which are not directly available or accessible on the SiteMap (e.g. Document Template, Email Template, etc.)

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

So we can make them accessible or available directly by adding its Relative URL in the SiteMap.

Let’s take example of Document Template entity, where we’ll use its Relative URL, and add the same in SiteMap i.e.  “/main.aspx?etn=documenttemplate&pagetype=EntityList” (see images below).

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

As you can see, by using Document Template’s Relative URL, we are able to open it in Classic Web. Now let’s take a look on how to achieve the same in Dynamics 365 CRM Unified Interface.

I’ve already created a Model-Driven App to perform the above in Unified Interface. I have used the same Relative URL which I used in Classic Web i.e. “/main.aspx?etn=documenttemplate&pagetype=EntityList

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

But when I click on it, I get the below error.

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

I entered the URL which I used in Classic Web but the same URL isn’t working in my Model-Driven app.

So after extensive debugging, I found out that the pagetype entered i.e. pagetype=EntityList is wrong, and it needs to be in lowercase.

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

So after changing the Relative URL to lower case “/main.aspx?etn=documenttemplate&pagetype=entitylist”, it worked like a charm.

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

Conclusion

As illustrated above, you can access the entities such as Document Template, Email Template, etc. on SiteMap with the use of Relative URLs. However, Relative URLs are case sensitive in Unified Interface. Make sure to enter proper Relative URL to avoid issues.

7 thoughts on “Use of Relative URLs in Dynamics 365 CRM Classic Web & Unified Interface SiteMap

  1. David

    Thank you for your post, it’s very useful.

    However, the functionality does not work properly, because if you click any of the buttons on the ribbon (for example, NEW button) an error message because of the library is displayed:

    Invalid JavaScript Action Library: /_static/_common/scripts/RibbonActions.js is not a web resource and is not supported.

    1. Inogic

      Hi David,

      The url have since changed in the new Unified interface. You can check the new url that it navigates to and add that to the sitemap to get it to work.

      it would be similar to https:///_root/homepage.aspx?etc=9940

      HTH

      1. Rares

        Hello,
        Thank you for the guide – very useful.
        Can you please share how to find the new Unified Interface URL for Document templates, so the “New” or “Upload” buttons actually respond to action ?

        Many thanks,
        Rares

        1. Inogic

          Hi Rares,

          When you perform the OOB ribbon action and after the process is completed, the updateView() of the PCF is invoked automatically.

          So you can just move your HTML creation logic in the updateView() instead of the init().

          Now when you select a row and click on the OOB delete button then by default updateView() will be called and since you are creating the grid based on the record which you are getting in the context you will not get the deleted record.

          Hope this answers your query!

        2. Inogic

          Hi Rares,

          The purpose of this blog is to show the difference between relative URLs when it is used to add components either in Classic sitemap or in Unified Interface sitemap.

          However, it seems not all the Ribbon buttons in Document Templates are supported in Unified Interface because when you navigate to Power Platform Admin Center -> Environment -> Settings as shown in the screenshot below. The Document Template is listed under the Templates area, on click of which it opens the Document Templates in classic view which can be verified by the presence of forceClassic=1 in the URL as seen in the second screenshot below.

          Hope this helps!
          Thanks

  2. loki

    is it possible for duplicate detection rule also ? i need duplicate detection rule as what you show for document template. please provide the solution.

    1. Inogic

      Hi,

      Duplicate detection rule is only available in Classic Sitemap with the help of below line:

      /main.aspx?etn=duplicaterule&pagetype=entitylist

      duplicate-detection-rule

      Thanks!

Comments are closed.