The eResources menu that can be accessed on the Account and Contact edit screens in Microsoft CRM is a great way to get contextual information from an external Web site based on the current record displayed. For example, these options can be used to get a list of restaurants near a customer's place of business or look at the weather in the customer's part of the world. However, there are only five resources available, new links cannot be added or removed, and the destinations of the existing links can't be changed.
NOTEAll but one of the default links on the Web Resources menu redirect the user to a Microsoft-owned Web site. The Research Company link refers to Hoovers. |
Now, we just said that the destinations of the eResources links cannot be changed, but that is not entirely true. When the user clicks on one of the five links, client-side JavaScript functions are called. Those five JavaScript functions are located in the webResources.js file under the forms folder. This file can be edited to redirect the user to a different Web site, but modifying standard Microsoft CRM files is, of course, not recommended or supported.
Let's look at what can be done, for example, to add a Web search engine link on the Lead edit screen. This link could be used to find out if the Lead has ever been mentioned in the press or has ever published articles. Another example is a link on the Account edit screen to a financial Web site such as Yahoo finance to get the company's current stock price.
Our solution to this problem involves creating additional menus in the CRM application, creating an ASPX page, and doing a little bit of C# (pronounced C sharp) programming. Conceptually, what we're going to do is create one Web page that gathers the information about the record currently on the screen, fetch additional data out of the CRM system, and forward the appropriate values to an external Web site.
Here are the steps to implement this solution:
The necessary files to re-create this customization can be found under the Chapter 14 examples folder on the companion CD-ROM. Figure 14.2 shows a Contact record with our Web Resources menu implemented.