Tuesday, 15 May 2012

Dynamics CRM 2011 upgrade and Outlook client re-deployment

Post revised on: 16/06/2012
 
Consider the following scenario:
You upgrading your company CRM 4 to CRM 2011 and the CIO has the following requirements:
  1. Minimum down-time possible
  2. Need to sign-off the new CRM 2011 environment/functionality
  3. Easy roll back process
  4. Minimum CRM Outlook Client disruption
Available upgrade options:
  1. In-place upgrade  (upgrade existing CRM 4 servers and database on-the-fly)
  2. Install CRM 2011 on new servers and upgrade existing database (Only changes the database, easier to roll back)
  3. Install new CRM 2011 and new database. Import CRM 4 database into the new CRM 2011 environment.

You need to consider the upgrade method that will minimise down-time and keep all Outlook clients connected.

Upgrade options minimise downtime
Option 1 and 2
These two options are not the most recommended approach when down-time needs to be kept to a minimum::
  • Option 1 
    • If issues encountered full re-install of CRM 4 is needed
    • Full database restore
    • No option for staging environment
  • Option 2 
    • Easier to roll-back no need to full re-install if you install CRM 2011 on different servers
    • Full database restore
    • staging environment only for servers, for roll-back you woudl still need a full restore

Option 3
This option is the most flexible and the less prone for errors. You install CRM 2011
  1. Keeps down-time to minimum option for full staging environment
  2. More flexibility with databases
    1. If during import you find an error, you can fix it on the CRM 4 environment, backup and restore again the database and re-try the import once again.
  3. Easiest approach even when you can't afford new servers, less prone for errors.
    1. You do a clean CRM 2011 install and can set up a vanilla environment to confirm all is working as it should.


Outlook Client re-deployment

To avoid re-configuring or upgrade all Outlook clients, you need to keep two important keys:
  1. User ID
  2. Organization ID
To maintain those keys on the new CRM 2011 database, you need to make sure while importing the new database you select Keep Existing User Mappings. This will keep all mappings the same and will allow old CRM 4 clients to connect to the new CRM 2011 environment.

Note: The fist time users open Outlook they will get a 404 error on the entities menus for the first minute while CRM loads the new settings. The client loads the new folder structure accessing a specific URL which loads the settings and the menus will then start working.

However if you are in a situation which the user mappings are correct but the organization ID has changed, you just need to update the registry key OrgID on the users local computer with the new Orgnization OrgID. This will enable the outlook clients to re-connect successfully.  The Organization Id is stored on the MSCRM_CONFIG database Organization table.

Create/add the following lines to the existing logon script:

reg delete HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient /v orgId /f 

reg add HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient /v OrgId /t REG_SZ /d "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}" /f 

Note: The Outlook client will still need to be upgraded if you want to make use of all CRM 2011 features.

Summary
  • To keep Outlook clients connected to thew new CRM 2011 environment keep the existing user mappings during the database upgrade
  • If you have available infrastructure the best approach is Option 3, more flexibility and less prone for errors.
Hope it helped

Tuesday, 24 April 2012

Dynamics CRM planning upgrade and system architecture

CRM 2011 has introduced a new system architecture that changes the way Outlook clients communicate with CRM back-end. CRM is less chatty and requires less services but is important to understand the impact on your old CRM 4 infrastructure when upgrading.

If you have a large number of users using the Outlook client then you may have noticed you have thousands of connections to the Platform servers. With CRM 2011 with the default options the front-end server now hosts these services, which means your front-ends will be hit with web traffic and Outlook client traffic at the same time increasing the load on these servers.

Dynamics CRM 4
The following diagram illustrates CRM 4 synch activity when users opens Outlook and when the CRM client is configured:
Note: The services used when the user opens Outlook are the same, when the Client performs a synchronization every 15min

Dynamics CRM 2011
On CRM 2011 by default the services have been moved to the front-end servers, the following diagram illustrates CRM 2011 synch activity:

Note: The services used when the user opens Outlook are the same, when the Client performs a synchronization every 15min 


Conclusion
  • A like-to-like upgrade (front-end, back-end), on environments with 500+ users, depending on server specifications you may expect heavy loads on the front-end servers, due to Outlook Client connections handling more traffic than normal leading to poor performance.
  • Ideally you want to place the CRM 2011 Discovery and specially the Organization Service away from the front-end servers.
  •  Another interesting design change is the Discovery Service is no longer used when synchronizing the Outlook client, which means you can place the discovery server in a low spec server or even turn it off.

I hope this information was helpful.




Tuesday, 10 April 2012

Dynamics CRM 2011 Scaling Email router with Business Units

I wrote an article a few weeks ago on how to install the email router on multiple servers. However the concept and method is a manual process and there is something new with CMR 2011 that can automate the process and easier to scale the email router.

With Dynamics CRM 2011 a new option was introduced on the security profiles that transforms the way we can use the email router. The new change I'm referring to is the queue security options, it has now the ability to read at different levels:
  • Business Unit
  • Parent-child Business unit
  • Organizational
  • User
 These options were not available with CRM 4, you could only do organizational or none. With the new options, we can easily scale our email router implementation by configuring different service accounts for each  business unit with permissions to read only at the business unit level. When installing the email router we specify which service account the email router should use. When using those specific accounts the email router returns only the users from that business unit.

The following diagrams illustrates how the concept works. First consider the following business unit layout:

We have a parent business unit with 4 child business units. Each child business unit represent the company office locations. Each city business unit will hold their own CRM users, security roles etc.

Below a more detailed diagram on how the different email routers would be placed and how many service accounts we would require in order to scale the email router:



The Service account requires Queue and User Settings Read permission at the business unit level.

The service account is configured on the email router configuration tool, deployment tab, deployment profile:



























Hope this was helpful.


Monday, 2 April 2012

Dynamics CRM 2011 jquery errors

Couple common jquery errors when playing with jquery in dynamics CRM 2011;

jquery Access Denied
When running the jquery script on a machine outside the development domain you get:
Access is denied.

>To resolve this, add the site URL to one of the IE zones and enable the following setting for that zone:








jquery '$' is undefined
'$' is undefined
>This issue is quite simple to resolve but can happen when you add web resouces in a different order. the Jquery webresource needs to be on top of the custom scripts that reference jquery syntax. when the scripts are executed the jquery library must have been loaded prior to the scripts execution, only then CRM 2011 will recognize the syntax.

Thursday, 22 March 2012

Future CRM with Metro UI

Images from Dynamics GP with the future Microsoft user interface Metro UI has emerged. I believe dynamics CRM will most likely have the same concept.

http://get-spblog.com/2012/03/20/metro-ui-applied-to-enterprise-apps-convergence-2012/#


Monday, 19 March 2012

Dynamics CRM Load Balance Email Router

View thewiki technet article hre: http://social.technet.microsoft.com/wiki/contents/articles/9162.dynamics-crm-2011-load-balance-email-router-en-us.aspx

We can load balance emails in dynamics CRM with a few customization steps using multiple email routers. The concept is simple, I use a workflow to generate emails and assigned those emails to specific users (service accounts). I link those users to a custom entity which will round robin (load balance) between them. On the same custom entity I create a counter field which defines the next user in sequence. Our load balance solution will require the following items:
  1. Custom Entity "Email pool".
  2. Entity Relationships 1:N (1 to many).
  3. Small piece of Javascript code to set the default email pool which controls the loop.
  4. Workflow to trigger the emails.
  5.  Database trigger to update the Email Pool counter.

The following diagram illustrates how we will load balance emails:


  • User creates a record
  • An email is triggered by the workflow
  • Workflow assigns the email to one of the 3 users
  • Email router processing email for that user will then deliver the email

Step 1 - Create and customize the new entity (Email Pool)
First we need to create our custom entity pool which will hold the users responsible for processing emails.

Go to: Settings > Customization > Customize the system > highlight entities > On the right click New
 

Now we create a field for each user:



Create Pool 1, Pool 2 and Pool 3

 Create a new field for the counter:


Now add the new fields to the main form:


Step 2 - Create the Relationship
Create a relationship 1:N (1 to many) with any entity which you would like to balance emails. On this article we are creating the relationship with the accounts entity.
The relationship should look like this:
 

 Step 3 - Create the email pool record and link the CRM users
Create 3 Users called Router1, Router2 and Router3.

Create an Email Pool record and assign the users, it should look like this:


 Step 4 - Customize the Accounts entity
The next step is to customize the Accounts entity to allow the Email Pool Entity to be referenced from within the account records.
We are adding the Email Pool field on the Accounts form:


You can customize the Email Pool field to be hidden by default or do that from the OnLoad event script.

Click on Form Properties and configure the following script:




Step 5 - Create the workflow
The workflow will send an email when the record is created. It reads the email pool counter and based on this value will route the email to the appropriate user in the sequence. A trigger on the database side will update automatically the email pool counter.




Step 6 - Update the Email Pool Counter
To update the counter we could create a workflow that would update the Email Pool counter field, however multiple workflows updating the same field is not a good approach and may result in locks. Instead of using a workflow we can update the counter field using a database trigger.

The trigger would look like this.


Step 7 - Set up the Email Router
The last step is to configure each Email Router to process email for the specific user. In order to do this the email router configuration file needs to be manually customized, adding the user ID and the update period set to 0. For more information on how to do this and understand the concept read of my articles on how to install email router on multiple servers:
http://quantusdynamics.blogspot.com/2012/02/dynamics-crm-installing-email-router-on.html 


Using Queues
It's possible to use the same concept but instead of users we can use queues. The process is the same, however we will need extra steps.
     The following diagram illustrates the same concept:




    Conclusion
    The concept works perfectly and is very reliable. You can extend the solution to provide some resilience implementing SQL scripts to move emails to different users in case the email router has crashed. 

    I hope you enjoyed it.