admin管理员组文章数量:1394067
Are there any tricks or tools for debugging those jScripts that you write in the web resources and attach to an event on a form ?
I have to customize a Dynamics CRM 2011 instance, which includes writing some jScripts.
The best I found until now is to click "I want to see the error that's being sent to Microsoft". Better than nothing, but I guess there must be something better ?
Thanks!
Are there any tricks or tools for debugging those jScripts that you write in the web resources and attach to an event on a form ?
I have to customize a Dynamics CRM 2011 instance, which includes writing some jScripts.
The best I found until now is to click "I want to see the error that's being sent to Microsoft". Better than nothing, but I guess there must be something better ?
Thanks!
2 Answers
Reset to default 3If you use a decent version of IE (I hope you do), you could use the developer tools (F12). They also contain a JavaScript console/debugger which got really usable in the meantime.
You have to select the file which should be inspected, set a breakpoint and start debugging.
See this article for an example: http://www.furnemont.eu/2010/06/how-to-series-easily-debug-your-crm-javascript-code-in-ie8
For development of form scripts use the Xrm.Page Script Library Template described in the SDK topic Write Code for Microsoft Dynamics CRM Forms. The CRM team blog post JScript IntelliSense for Form Script Libraries provides an overview.
When you use this template, in addition to providing form specific IntelliSense, you can debug your scripts in Visual studio without uploading them as Web resources. This makes initial development and debugging easier.
After you have it working, then create a JScript web resource and register it as a form event handler and test it in the application. At that point, use the technique described in the How-to series: Easily debug your CRM JavaScript code in IE8 (link in other answer) to debug your script using the IE developer tools.
The advantage of debugging your scripts outside of Microsoft CRM is simply that it is simpler. CRM loads many different scripts into the forms that it is sometimes tricky to isolate just your script.
本文标签: javascriptHow to debug jScript for Dynamics CRMStack Overflow
版权声明:本文标题:javascript - How to debug jScript for Dynamics CRM? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744659810a2618174.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论