Now we have a
basic understanding of web resources, let's create a web resource of the type JavaScript that will have the function name Hello
, and attach it to a Microsoft CRM 2011 entity.
Use the following steps to create a "Hello World" JavaScript web resource:
Navigate to Settings | Solutions and open the MyDevelopment solution.
Navigate to Web Resources and click on New.
Enter the following information:
Name:
HelloWorld.js
Display Name:
HelloWorld
Type:
Script (Jscript)
Language:
English
Click on Text Editor.
Enter the following code under Source Field:
function Hello() { alert('Welcome to Web Resource'); }
Save and publish the web resource.
Now that our web resource is ready, we can attach this web resource to the entity form and associate our Hello
function with the form entity event. Let's call this function in the OnLoad
event of the account entity form.
First we need to add the account entity to our solution. Once the account entity...