Tags: , | Categories: CRM, Knowledgebase Posted by Ian Blair on 2/28/2011 2:25 PM | Comments (0)

The JavaScript editing functions in CRM are a bit basic, and it is very easy to spend hours debugging a small bit of code by simply looking at it in the native CRM JavaScript edit field.

There is an easier way, just by making a small change to the Advanced Settings in IE and adding a single line to your code, you can have the luxury of stepping through your code, or setting breakpoints just like you would in a grown up language like C# or even C++.

To do this first make sure that Script Debugging in Internet Explorer isn’t disabled. To do this go to the Internet Explorer settings in Internet Options under the Tools menu, and select the advanced tab, and scroll down until you see the "Disable Script Debugging (Internet Explorer)" option. Make sure it isn’t checked.  Press Apply and then close the dialog box.

Next in the block of JavaScript you want to debug in CRM, add the following statement

debugger

This should appear at the point that you want debugging to start, but for ease of use can be added as a first line in the JavaScript block.   Once this statement is encountered it will fire up a list of debuggers that you can use to step through your JavaScript code.

You just have to remember to remove the line or comment it out before you give the changes to your users, otherwise each time they execute your code it will ask them if they want to debug it.

 

Tags: , , | Categories: CRM, Knowledgebase Posted by Admin on 2/23/2011 8:25 PM | Comments (0)

A while ago I was faced with the problem of finding the SQL server and database name for a UAT CRM instance that I didn't install. And unfortunately the user who installed it wasn't around and hadn't granted any other users rights in the Deployment Manager Tool, so a quick fix was needed.

After a little bit of research I discovered the database connection strings are held in the following registry hive on the actual CRM server.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM 

The keys that contain the SQL strings are   configdb,  database,   metabase

Not rocket science really, but useful if you need to quickly find the databases and all else has failed.