Home › Dynamics 365 Customer Engagement (CRM) › Open HTML Page from Button with Ribbon Workbench
Dynamics 365 Customer Engagement (CRM) · Nov 17, 2016 · 2 MIN READ

Open HTML Page from Button with Ribbon Workbench

There may be a requirement to open an HTML page from a button. In this example, we will use the Ribbon Workbench to open a page from a button.

First, create a new solution and go to Web Resources:

Click New and enter details for the HTML page. Select Type:

Select Type as Webpage and then select Text Editor:

This will open an HTML page:

Selecting the Source tab will show the HTML:

Enter some text and press OK:

Press Save and Publish:

We now need some JavaScript to open the new page. Create a new Web Resource, this time JScript:

Go to the text editor and enter a function that will open the page:

function OpenPage () {
   Xrm.Utility.openWebResource("new_TestHTMLPage.html");
}

Now we will add an entity to our solution that will have the button we are launching this from. Add the account entity:

Save and publish the solution. We can now use the solution in Ribbon Workbench.

Go to Ribbon Workbench:

Select Open Solution:

You may need to press Refresh. Select the resource and click OK:

The workbench will open:

Drag a button from the Toolbox to the Form area:

Rename the button:

Click + to add a command:

Under Actions, select Add Action and JavaScript:

Type the name to look up the resource:

Add the Function Name:

Then set the command just created on the button:

Click Publish:

Open the Account form. The new button will appear in the ribbon:

The JavaScript is called and the web page opened:

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

2 Responses to Open HTML Page from Button with Ribbon Workbench

  1. after doing same procces,one window pop up and i am getting this “HTTP Error 404 – Not Found” please help!

    • It gave your error because your function is like this:
      function Openweresource() {
      //alert(“function called”);
      Xrm.Utility.openWebResource(“new_webpagename.html”);
      }
      the correct solution will be not add the .html.

      correct solution is like:
      function Openweresource() {
      //alert(“function called”);
      Xrm.Utility.openWebResource(“ssc_Account_Wastecarrrier”);
      }

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.