HTML Web Resources
Microsoft dynamics crm tutorial
HTML Web Resources
In this chapter, we will learn about the different Microsoft Dynamics CRM web resources.
HTML web resource applications
An HTML web resource in CRM can contain any HTML content that can be rendered in a browser. Consider the following scenarios where you want to use HTML web resources -
You have a static HTML page that you want to display in the CRM screen .
You have a custom HTML page that expects certain input parameters and is rendered based on those input parameters. For example, let's say you are retrieving information from an external API or web service and want to display it in CRM.
You want to display some information with different look and feel from standard CRM user interface.
Youhave a custom ASPX page (outside of the CRM application) which is rendered according to the input parameters. Since CRM does not allow you to have ASPX web resources, you can create an HTML web resource and call the external ASPX page from that HTML page.
Sample HTML Web Resource
We are going to create a very simple HTML web resource that will display a custom "Welcome to TutorialsPoint" text. Note that this is a very simple example of an HTML web resource. In practice, HTML web resources would be more complex than that.
Step 1 - Create an HTML file named sampleHTMLWebResource.html and copy the following code.
Welcome to Tutorials Point
Welcome to Tutorials Point. This is an example of an HTML web resource.
Step 2 - We will first create a new resourceource Web, then refer to the contact form. Open DefaultSolution and go to the WebResources tab in the left panel. Click on New.
Step 3 - This will open a new web resource Enter details as shown in the following screenshot and browse the HTML file we created in step 1. Click Save and Publish. Close window.
Step 4 - You will see the new web resource added to the web resource grid.
Step 5 - Now open the contact form via Settings → Customizations → Customize system → Contact → Main form. Contact Info section and go to Insert tab in top ribbon bar. Click Web Resource.
Step 6 - This will open an Add Web Resource window. Click on the search for web resources in this window, which will open the registration window Find the web resource you just created (new_sampleHTMLWebResource), select it in the grid and click Add.
Step 7 - Returning to Add a web resource, enter the name and label as indclicked in the following screenshot and click OK. Close the window.
You will see the added HTML web resource under the Address field.
Step 8 - To test this open any contact record and you will see the HTML Web Res our content displayed here .
Limitations of HTML web resources
There is no supported way to use server side code in HTML Web Resources.
HTML Web Resources can only accept a limited number of parameters. To pass more than one value in the data parameter, you will need to encode parameters including decoding logic at the other end.