Thursday, January 7, 2010

Debugging Script with CRM events

Writing JavaScript in CRM is a tedious job and finding the error in your script is even more difficult. The best way to find the error cause is to debug it. The blog will give you the steps to debug the scripts added on form events in CRM.

Steps to enable debugging script:

- Go to Internet Explorer settings.
- Click on Tools and select Internet Options. You will we see following screen.


- On the Advanced Tab, under Browsing find the Disable script debugging (Internet Explorer) option and uncheck it.
- In the script use “Debugger”, just before the statement where you want to start your debugging session.
- For example: you can write script under the CRM events such as onLoad, Onsave etc.
debugger;
//after start to write script
- After add script ,save it and publish. Refresh the page, you will see following screen.


- Select new instance of visual studio 2008/2005 and click on yes. After this open script code on visual studio for debugging mode where you can debug own script. (See below the screen)

No comments:

Post a Comment