

Dynamically maybe? My javascript is being run from a ribbon button so is defined in the customization XML like this:

I guess it's got something to do with the way CRM is loading the Javascript. One of those script blocks will contain a copy of my Javascript file, and if I put breakpoint in there it does stop. "Other", when I select that I get list of (anonymous?) script files all called script block (n) where n is a number. In order to get it to work in IE9 I have to scroll down the list of Javascript files until it says I can see my file, I add a breakpoint, it never stops. My file also has "debugger " as the first line of the function being called from the ribbon button but it never breaksĪs I mentioned, in the IE9 debugger exactly the same behaviour happens (after I click Start Debugging). I can see my javascript file in the list of loaded files, I can put a breakpoint on it, but it never stops on that breakpoint. Jim Daly Technical Writer Microsoft Dynamics CRM Most of the cross browser issues I've encountered occur due to parsing XML. StackOverflowįinally, please review the information here: I'd recommend going to the forums for those developer tools to try and get information. This will write messages to the console rather than potentially getting into a never ending loop of alerts that you might have to close out.Īfter using IE Developer tools for years, I am still not used to the developer tools that other browsers provide. I try to do as much testing and development outside the application as possible, and then just do final testing within the application.Īnother tip, use a function like this: //Helper function to write data to the console The application loads so many scripts that even with IE it is tough to separate them and get good breakpoints. The ribbon and it will be a lot easier to debug. If you can get it working there, it should work within
#FIREFOX FIREBUG JAVA SCRIPT DEBUGGER CODE#
You should be able to create a simple test harness to run your code in a simpler environment. I'd recommend trying to create an HTML web resource to test your ribbon code outside the ribbon if possible. Net developer for many years, I'm very much new to Javascript, so go easy on me :) So my question is, how the hell do you debug a javascript web resource (not on an entity page) from Firefox or Chrome, and if you can't do it, how on earth do I work through cross-browser problems? I've also tried adding "debugger " to my Javascript but FireBug is still not stopping. Surprised at this because when debugging in IE I have to click "Start Debugging" and look for my code in the code blocks listed under "Other", but I'm not sure how I can replicate this using FireBug. I've tried using the built in Firefox tools and Firebug, and although I can see my Javascript file breakpoints are not being hit. I'm not (at this stage) asking for help with the code, but I cannot figure out a way to debug my Javascript. This means that my alert shows "x added, x failed" instead of "x added, x duplicates". In IE9 this is all working absolutely fine, however in both Firefox and Chrome, whilst functionally it is working OK, the bit where I'm checking for the duplicate message returned by the service call in the responseXml ("Cannot insert duplicate key.") The alert displays the the number of contacts added, the number of contacts that are already going to the event (duplicates) and in theĮvent of any other failure the number of service call failures. Once the service calls have completed I display an alert (if there's a better CRM way to do this then please tell me).Once an event is chosen the Javascript code calls the web service, once for each contact, using an AssociateRequest to create a relationship between the event and the chosen contacts.When the button is clicked it opens a lookup which allows me to chose a single event (which is a custom entity).I added a button to the homepage ribbon for Contacts (i.e the list of contacts).In terms of functionality what I'm trying to achieve is to add Contacts to an Event (custom entity), so: This is CRM online, R12 (Polaris) with cross browser support.

I'm having a complete nightmare trying to debug some Javascript that is working in IE but not in Firefox and Chrome.
