Thursday, June 27, 2013

How to use Fiddler to debug CRM 2011 Javascript and HTML Webresources


Hi Guys,

In order to properly develop JavaScript and/or Html webresources, a CRM 2011 developer needs to make many publications on CRM development server, sometimes, with many errors. And when a team works on the same server, especially on the same entity, that can make the work troublesome and make any back slowly during these publications.

Using Fiddler 2 locally as an auto-responder is the solution.  


As a web debugging proxy, Fiddler will intercept any session (web call) outgoing form your local machine. And it can redirect some session to call instead of letting it out to web server. This is the role of the Auto-Responder.



And now, follow these steps:


  1. Launch Fiddler 2
  2. Make a Filter to show only sessions going to CRM Server like this:

  3. After this operation, select all session in the “Web Sessions” list and remove theme.

  4. Open IE and go to “ Inernet Option”, and delete “Temporary Internet Files and Website Files” like this :


  5. Back to Fiddler and click to Autoresponder tab.
  6. Ckeck this two options

  7. In Web Sessions List, Select Session line corresponding to your javascript/Html webresource that you want to work on then, drag and drop it in " If URI Matchs..." list.


  8. That add a line in this list. This line starts With the keyword : "EXACT". The same line is added in the first combbox of the "Rule Editor", and a in the second combobox this string "*200-SESSION_211" is added.


  9. You need to replace EXACT keyword by REGEX keyword In the first combobox, then replace the entire URL string up before the name of the WebResources by "*/" and finally you need to add ".*" in the end of string like this : 
  10. EXACT:http://ServerName/OrgName/WebResources/new__common.utilities.js
    become
    REGEX:.*/new_common.utilities.js.*



  11. After that, in the second combobox, put the local file path of your webresource like this:




  12. Finally click to Save.
Repeat this operation for all your webresources that you want to work on. and not forget to empty Temporary IE Files everytime you want to put a new webresource.

Have a nice Day.

I hope that this post helps you.

N.JL

4 comments: