Tuesday, February 22, 2011

Using JQuery in CRM 2011

JQuery is not supported in CRM 2011. Some of the updates using Jquery does not work, but it can be used in displaying data like hiding tabs/sections/fields. JQuery reduces amount of JScript lines required to do the same functionality. I am using jquery-1.4.3.min.js file as a webresource.

Here is a simple example to hide a tab in CRM form

function ToggleTab(tabName , HideStatustrueOrfalse )

Add webresource into your form and form onload event mention function name and pass parameters like 'YourTabName', 'false' to hide the desired tab. On similar note you can hide the sections, fields on the CRM form.


Remote Degugging in CRM 2011

It was time to find how do I really debug my CRM Plugin or custom workflow without ever going back to my CRM server in cross domain. Here are the steps to do that. Assuming that your client has Visual Studio 2010 with 64-bit:

  • Copy folder c:\program files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64 from your client to same path in the CRM server

  • In server Run as administrator msvsmon.exe , make sure that msvsmon console shows connected as CRMDOMAIN\crmservice@CRMSERVER

  • In client create local user crmservice with same password as crmservice user in server

  • In client open the plug-in solution in visual studio 2010 build. Copy the dll & pdb files(pdb file if plugin is registered in database) from debug folder to server path C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly folder

  • In VS-2010 click tools? Attach to Process select Transport as Default and Qualifier as CRMDOMAIN\crmservice@

  • Click ‘Show process from all users’ select w3wp.exe process to start debugging
    Attach the debugger to the process on the Microsoft Dynamics CRM server that will run your plug-in. Refer to the following table to identify the process

Here CRMSERVER=Name of CRM Server, CRMDOMAIN = Domain name for CRM Server and crmservice = crm user
I had my firewall disabled in my VPC/VMWare/CRM Server

Happy Debugging :)