Applications of CRM HTML Web Resources
The HTML Web Resource in CRM (Customer Relationship Management) can contain any HTML content that can be rendered on a browser. Consider the below scenarios where you would like to use HTML Web Resources −
- You have the static HTML page that you want to display inside CRM screen.
- You have the custom HTML page that expects some input parameters and gets the rendered based on those input parameters. For example, consider you are fetching the data from the external API or web service, and you want to display this in CRM.
- You want to show some data with a different look and feel from the standard CRM UI.
You have the custom ASPX page which gets rendered based on the input parameters.
Since Microsoft Dynamics CRM does not allow you to have ASPX web resources, you can create an HTML Web Resource and call the external ASPX page from this HTML page.
HTML Web Resource Example
We will create a very simple HTML Web Resource which will display a custom text ‘Welcome to Dynamics support desk’. Note that this is the very simple example of the HTML Web Resource. Practically, HTML Web Resources would be more difficult than this.
Step 1 − Create the HTML file named sampleHTMLWebResource.html and copy the below code.
<!DOCTYPE html> <htmllang = "en"xmlns = "http://www.w3.org/1999/xhtml"> <head> <metacharset = "utf-8"/> <title>Welcome to Tutorials Point</title> </head> <body> <h1>Welcome to Dynamics Support desk. This is an example of HTML Web Resource.</h1> </body> </html>
Step 2 − First, we will create a new Web Resource and then reference it on the Contact form. Open the DefaultSolution and navigate to WebResources tab from the left panel. Click New.
Step 3 − It will open the New Web Resource window. Enter the details as displayed in the below screenshot and browse the HTML file that we created in Step 1. Click Save and Publish. Close the window.
Step 4 − You will view the new Web Resource included to the Web Resources grid.
Step 5 − Now open Contact form via Settings → Customizations → Customize the System → Contact → Main Form. Choose the Contact data section and switch to the Insert tab from the top ribbon bar. Click Web Resource.
Step 6 − It will open the Add Web Resource window. Click to the Web Resource Lookup from this window, which will be open the Web Resource Lookup Record window. Search the Web Resource that you just created, choose it from a grid and click to the Add.
Step 7 − Coming back to Add Web Resource, enter the Name and Label as displayed in the below screenshot and click OK. Close the window.
You will see the HTML Web Resource included below the Address field.
Step 8 − To test this out, open any Contact record and you will view the HTML Web Resource content displayed there.
Limitations of HTML Web Resources
- There is no helped way of using the server-side code in the HTML Web Resources.
- HTML Web Resources can accept only a limited number of parameters. To pass more than one value in the information parameter, you will have to encode the parameters include decoding logic on the other end.