Category Archives: Microsoft CRM 2011

All about Microsoft CRM 2011

Actions to improve performance in Microsoft CRM On Premise – 11 Checks

Performance is always a great concern for any CRM implementation and there are few key things need to consider when analyzing performance improvement. I thought it would be helpful if I summarize the basic key checks to be done to improve the performance in Microsoft CRM On premise deployment.


1. Check – Principal Object Access table size

One of the key reasons for performance issue in Microsoft CRM is the improper maintenance of its database which results in the huge number of records in POA table.

Proper actions need to be taken to clear the POA table as well as to control the growth of this table to get the system working smoothly.

Query to find the table count:

–Get the total number of shared records grouped by Entity

  1. Clean-up Principal Object Access

In order to clean-up this table, the following actions should be made:

  1. Schedule a Bulk Deletion Job which would delete all completed and cancelled ‘Workflow logs’
  2. Schedule a Bulk Deletion Job which would delete all completed and cancelled ‘Process Sessions’
  3. Execute Microsoft recommended SQL command to clear the records from AsyncOperationBase and POA tables
  1. Control records growth in POA table
  1. Set the option to delete workflow Log after the completion of Async plugins⁺ and in Workflows⁺
  2. Change the custom relationship behaviour from ‘Parent’ to ‘Referential’ or equivalent for the most affected relationships
  • ActivityPointer
  • Annotation
  • Incident

3. Build and schedule a weekly maintenance job to clear the completed and cancelled           workflow logs older than x months


2. Enable the ‘EnableRetrieveMultipleOptimization’ registry key


Please note that enabling this will cause the queries to make use of temp tables

3. AsyncOperationBase table maintenance

Problem Statement:

The workflows in the Dynamics CRM organization are configured to log every successful execution. If there is no business need to audit on successful executions, the data logged should be avoided. Having huge number of records in AsyncOperationBase table will have impact on performance.


In order to maintain this table the following activities will be implemented:

  • Assess Workflow Job Retention option for all workflows
  • Schedule the Clean up task for cleaning the asynchronous table
  • Develop a query which looks for record count in the asynchronous table.
  • Review the automatic schedule job timings for clean up and change if required.


4. Check if schedule maintenance jobs are failing and need to be monitored and rectified


Problem Statement: If CRM maintenance jobs are not running in the system, this results in DB having huge number of orphaned and obsolete records which would affect the performance of the system.


There are schedule jobs running in the CRM app server which can be scheduled to run during the off-business hours.

Also ensure that the below listed maintenance jobs are running effectively in the system.

  • Deletion Service
  • Indexing Management
  • Reindex All
  • Cleanup Workflows


5. CRM database – sharing memory resources with other databases on the SQL instance


When the Dynamics CRM database(s) share resources with other databases, the performance will be impacted. Monitoring for usage of the machine vitals

(memory, disk IO, network, CPU) will help in determining the impact it is having on the performance on Dynamics CRM.

To ensure predictability, the Dynamics CRM database should not share resources

with other applications, databases or servers.


There should be plans to move non-CRM Databases to a different DB instance

as per the best practices.


6. Enable “Auto update statistics” settings for query optimization

This setting will check for indexes that require statistics update and update automatically and thus improve the performance


7. Optimize CRM built-in maintenance jobs with Indexes

Check if proper indexes are added in AsyncOperationBase table. If the index is missing in this table clean up activity will be delayed/failed


8. To make use of “ExecuteMultiple” in bulk data update/create activities

ExecuteMultiple will work much faster compare to the “Execute” method as it will process requests in a batches [upto 1000 requests in 1 batch]

 9. Check if the “Business Unit” structure is implemented appropriately

Ideally “Business Unit” in CRM should be the backbone of the security model and thus the focus on using CRM business unit should be on designing the proper security model rather than business’s Business model. Creating huge number of CRM Business Units would also create x times Security Roles. Which will have an impact.


For eg: if the security requirement doesn’t need to segregate information across mulple functional Bus within the organizations, it doesn’t necessarily need to create CRM Business Unit. A custom Business Unit entity can be used to serve the purpose and hence reduce the load in CRM Business Unit structure.


10. Check for Higher Index Fragmentation in CRM Database

Having more number of fragmented indexes with average fragmentation count higher than 20 will have huge impact on SQL Server performance

11. Settings to improve the AsyncService performance

Better usage of the AsyncService settings would improve the load on SQL Server as well as the Async Server

Eg: Setting lower values for AsyncItemsInMemoryHigh and AsyncItemsInMemoryLow


This blog has the settings in more details:





Unable to get property ‘firstChild’ of undefined or null reference – Error accessing Microsoft CRM

You might have received this annoying popup error while accessing Microsoft CRM. You might wonder if there is anything wrong with the Jscript customization in your solution! This is actually a browser related problem and you can fix it quickly.

Resolution: Add the CRM url to the ‘Trusted sites’ list and you would not get this issue. Its related to the activex control access.

Changing parent BU removes security roles assigned to the users of that BU – Issue fixed in CRM 2015

There was a strange issue in CRM 2011 where the security roles of users part of a BU get removed when the BU’s parent BU is changed. This issue seems like fixed by Microsoft in CRM 2013 RU2 and we do not see that issue in CRM 2015 either.


If you are still using CRM 2011 and are affected with this issue, a work around would be to reassign the security roles through custom code or from UI after the parent BU change.

Through Code:

<pre>// Associate the user with the role.
        if (_roleId != Guid.Empty && _userId != Guid.Empty)
                        new Relationship("systemuserroles_association"),
                        new EntityReferenceCollection() { new EntityReference(Role.EntityLogicalName, _roleId) });

            Console.WriteLine("Role is associated with the user.");

How to Audit user Login information in CRM 2011

How to Audit user Login information in CRM 2011


In order to view the User Access information in the Audit, User Access Audit option should be enabled in the system settings in CRM

Steps to do that:

  1. Go to Settings >Administration > System Settings => Auditing
  1. Check the Audit User Access check box to enable user access auditing

Read the rest of this entry

CRM 2011 Integration with SharePoint: Custom Document Management


There is a good post on Custom integration of CRM 2011 and SharePoint from CRM Consultancy blog

Snippet from the post

This article aims to describe how we can leverage this flexibility via custom development to define a more bespoke Document Management solution between SharePoint 2010 and CRM 2011, using different arrangements of Document Libraries, Folders and an initial look at Metadata.

Developing a Plugin to integrate CRM to SharePoint

Towards achieving a custom format of Document Management between CRM and SharePoint, we can look at creating a Plugin which will automatically integrate a new CRM Record with a new SharePoint Document area for a particular entity or entities in CRM.

This is similar to how custom Document Management Integrations were often implemented between CRM 4 and SharePoint 2007, however with the advent of SharePoint 2010 we are able to use the SharePoint Client Object Model to make this development simpler and less code-heavy. The aim here being to focus on the desired business logic of our Document Management and not get bogged down with the coding for the SharePoint development.


This concept of using CRM Development to control the Document Management between CRM and Sharepoint allows us a great deal of flexibility in how documents for a CRM Solution could be structured.
As we have seen here this allows a Solution Architect to consider other methods of governance when storing documents provide the initial folder-per-entity structure that CRM provides by default. The inclusion of SharePoint Metadata then allows this to be taken one step forward towards SharePoint best practice for managing volumes of documents – essentially providing methods for taking unstructured document data and streamlining this into a structure that fits the business. (or in a more snappy way, working the way you do, and not you working the way the software does)
Moving beyond this, for the next article in this series I will aim to look into how the concept of SharePoint Metadata can be used alongside CRM for SharePoint Views and Templates to further extend a custom document management configuration, and begin to looking at how we could handle the migration of legacy data into CRM and SharePoint.

Read the full post here:

**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

How does CRM 2011 and SharePoint integration work?

CRM 2011 and SharePoint integration

Here is a good post on CRM -SharePoint integration from CRM Consultancy Blog:

Snippet from the post:

One of the best new additions to CRM 2011 is tight integration with SharePoint 2010 for storing documents.  In the past when using v3 or v4, CRM Projects have been forced to develop custom code to integrate CRM with SharePoint, but now the standard CRM functionality allows the two products to be integrated and easily configured in the CRM 2011 settings area.

Following the CTP and release of 2011 at the beginning of this year, many great articles have been written and posted on the web to provide step-by-step guides for connecting CRM to SharePoint using this functionality:

However as with many areas of ‘out-of-the-box’ functionality the default integration is limited in certain ways.  This article aims to take a deeper look at this integration between CRM 2011 and SharePoint to examine how the integration works ‘under the hood’; with the aim of understanding how CRM 2011 has implemented this integration and how it could be extended further to meet the requirements of more complex Document Management scenarios.

The crucial understanding here is that this structure of a Document Library per Entity Type with Folder per Entity Record is simply the default business logic provided by CRM 2011 – and is in no way set in stone as the functionality provided by the SharePoint Site and Document Location entities in CRM can easily be extended to provide bespoke business logic for tracking documents.
As with many areas of Dynamics CRM, the application here provides a platform of functionality that can either be used in it’s default configuration or be extended via custom development.
In terms of why we may want to do this, when we look at the standard SharePoint integration here we can see some limitations for Document Management:

  • a single Document Library is storing all the CRM Documents, this could result in a single huge Document Library when it may be better to spread out the documents across multiple document libraries.
  • the Document Structure is heavily dependent on nested folders, this can often create a confusing layout for storing documents; and long-time SharePoint experts generally shy away from heavy use of folders for creating good Document Management governance. (SharePoint Document Libraries and Horrors)
  • Without customising the Document Library in SharePoint, the Document Structure does not make use of SharePoint Views or Metadata for managing documents.

Read the full post here:
**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

How to Get the value from a CRM field

// JavaScript/JScript in CRM 2011 | CRM 2011 Training Series
    //How to Get the value from a CRM field
    var varMyValue = Xrm.Page.getAttribute(“CRMFieldSchemaName”).getValue() ;

//How to Set the value of a CRM field
Xrm.Page.getAttribute(“po_CRMFieldSchemaName”).setValue(‘My New Value’);

 **For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

How to get Form Type using JavaScript in CRM 2011

Top_bottom banner


Get Form type using javascript in CRM 2011 :

When you write Java script/Jscript code on CRM forms, there will be situations where you need to trigger the script only on certain forms. This is how we get the Form Type.
In CRM 2011, there are 7 types of forms are defined.
0 – undefined
1 – Create
2 – Update
3 – Read Only
4 – Disabled
5 – Quick Create (Deprecated)
6 – Bulk Edit
The below script checks the form type and alert if the form type is of ‘Create’ form.
//Get form type
var CREATE_FORM = 1;
var type = Xrm.Page.ui.getFormType();
if(type = CREATE_FORM)
alert(“This is Create Form”);
Hope this helps!

Please share |Like in Facebook if you feel like this page is useful.

Top_bottom banner

How to Get the label of the control using Javascript?

// JavaScript/JScript in CRM 2011 | CRM 2011 Training Series
// How to Get the label of the control using Javascript?
    Xrm.Page.ui.controls.get(‘<Attribute Name>’).getLabel()
    // Get record id
    // set field as required based value of a check box field.
    function OnChangeBoolField()
    var varBool =“<Boolean Field Name>”).getValue();
    if(varBool == false)
     Xrm.Page.getAttribute(“<Attribute Name>”).setRequiredLevel(“required”);
     Xrm.Page.getAttribute(“<Attribute Name>”).setRequiredLevel(“none”);
**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

How to Get the changed data from form using Jscript?

/ JavaScript/JScript in CRM 2011 | CRM 2011 Training Series

//How to Get the changed data using Jscript?
var ChangedData =;

 **For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.