Monday, September 27, 2010

Javascript and CRM 2011

In crm 2011 the way to interact with objects thru JS is different than crm 4.0.
so for a simple way to make practice follow the followings

Please follow the below steps:

Create a .JS file and put the below code in file and Save the file.

function CallLoad()
var accountNameAttribute ="");

1. Go to Customisations -> Account Entity -> Forms -> Open Main "Information" Form

2. Go to Form Properties.

3. Add a new Web Resource by pointing and uploading the file [Please specify the values when creating the Web Resource: Type = Script (JScript), Language = English, and upload the file.]

4. Once you upload and select the web Resource, Go to Event Handlers Section in Form Properties. select CONTROL = FORM and Event = OnLoad or OnSave

5. Add a new Libraty, Select Library = uploaded Web Resource EG: new_AccountJS [Web Resource Name]).

6. Specify the function name = CallLoad

7. Chech the Enabled check box.

8. Click Ok, Click Ok to close the Form Properites window.

9. Save the Form, Publish the Entity.

10. Refresh your CRM Applciation.

And, here you are all set to have fun with Javascript in CRM 2011 Beta.

Hope this helps.


No comments:

Post a Comment