Debug the JavaScript that we write for some validation on entity pages in Dynamics CRM
Microsoft Dynamics CRM 2011 provide many opportunities to use JavaScript. You can use JavaScript to perform actions in form scripts, ribbon commands, and web resources.
Following are the steps that are needed to be followed:
- Enable the Debugging in the Internet Explorer - Go to Tools >> Internet Options (wizard will appear >> Click the 'Advanced Tab' >> Under Browsing Section uncheck the 'Disable script debugging' checkbox >> Click OK.|
- Edit the java script code of the Entity Page that you want to debug.
- Put the statement 'debugger;' above the line where you want do the debugging. e.g. suppose my java-script show 'Hello World' message and want to debug this then following is the way I am going to add script:
debugger;
alert('Hello World')
- Save and Publish corresponding customization.
- Perform the operation that would trigger the java script written by you
- Debugger dialog box will appear and select appropriate debugger (Visual Studio new or existing instance)
And you may start debugging from the 'Debugger' statement of your JavaScript.
Also Each browser provides some kind of debugging extension. Internet Explorer provides developer tools you can use to debug scripts in Microsoft Dynamics CRM. The Internet Explorer developer tools can be opened by pressing F12 when viewing a page using Internet Explorer.