Open HTML in Model pop up in D365 CE | CloudFronts

Open HTML in Model pop up in D365 CE


When HTML is opened using JavaScript, it can either open in the same window or a different one. This naturally can create ambiguity for the end-user, as the user can either lose focus or reopen the page, which is not a good practice.


In this blog, we will look at how we can open the model pop up on the click of a button. 





Xrm.Navigation.navigateTo requires two parameters.

  • pageInput
  • navigationOptions

pageInput: Here you define whether you want to open the HTML Web resource or you want to navigate to the entity list(View).

For HTML Web Resource:

  • pageType: “webresource”, //pass this as it is
  • webresourceName: “cf_TestHTMLCustomizations” // The name of the web resource to load.

For entity list:

  • pageType: ” entitylist”, //pass this as it is
  • entityName: “account” // The logical name of the entity.
  • viewId: “00000000-0000-0000-00AA-000010001002″ // Id of view

navigationOptions: Options for navigating to a page: whether to open inline or in a dialog. If you don’t specify this parameter, page is opened inline by default.

Below shown is the Code:

loadHTML = function() {
     var pageInput = {
     pageType: "webresource",
    webresourceName: "cf_TestHTMLCustomizations"
var navigationOptions = {
    target: 2,
    width: 400,
    height: 300,
    position: 1
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
    function success() {
     // Handle dialog closed
           console.log("Inside Success");
    function error() {
          Xrm.Navigation.openAlertDialog({ text: error.message });

– Call this function on click of button.

– After doing everything successfully when you will click on button it will open model pop up like below.


Refer for more details:

Share Story :

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.