DCSIMG
August 2012 - Posts - Yaniv Arditi

Yaniv Arditi

Microsoft Dynamics CRM and stuff

Syndication

August 2012 - Posts

One of my colleagues has pointed out this article, describing Microsoft CRM 2011 Timeouts and Limits.  At last, this useful info is concentrated in one clear resource. It should appear in Microsoft Dynamics CRM 2011 SDK.

To help propagate  this information, here it is again:

 

Timeouts

Limits

  • Fetch Aggregate Limit
  • Query Result Limit
  • Infinite Loop Detector
  • Duplicate Detection Rules
    • Default is 5 published rules per entity
  • Excel Export
  • Managed Solutions
    • you cannot change your publisher if you share an updated version of a previous solution you´ve deployed under another publisher (so keep in mind your prefix)
    • you cannot start auditing for any of your entities just by providing them within a managed solution
    • you cannot set the default dashboard by providing a managed solution
    • you cannot set the default public view by providing a managed solution
  • Data Import
    • CRM 2011 Online: single file must be less than 8MB
    • you can zip many files to one .zip-file. This file has to be less than 32MB
    • when you upload the zip file, CRM 2011 unzips it on server and process the files individually. Because of the 8MB limit if any single file is greatet then 8MB limit this file will fail
  • Sub-Grid
    • The first four sub-grids can be populated with data in a form when it loads
    • If more than four sub-grids exist on a form, the remaining sub-grids require some user or form script action to retrieve data
  • Outlook Reading Pane
    • Form events do not occur in the reading pane so form script event handlers are never called
    • If you are using multiple forms for an entity, only the default entity form will be used for the reading pane
    • The reading pane does not display IFrames, Subgrids or Web Resources

The Plugin based Auto Numbering solution suggested by KHeiman here is brilliant.
It can be packaged in Microsoft Dynamics CRM 2011 solution, can be deployed online and take advantage of the plugin built-in transaction support feature. 

One thing to note though, is that plugin transaction spans across all execution pipeline events. That means that the transaction will begin on the first pre-event plugin registered for the message/entity combination and will end after the last post-event plugin registered for  the message/entity combination is executed. If you rely on plugins to perform time consuming operations, the transaction lock may last longer that you expect, locking the auto-numbering functionality and slowing down record creation process.

One way to work around this, is to place the  auto-numbering plugin last in the plugins execution order, if the required business functionality allows this. This will shorten the transaction lock to minimum and improve the record creation process efficiency. 

Microsoft Dynamics CRM 2011 Grids display the number or retrieved records for the selected view, as long as the number is lower than 5000. When the number exceeds 5000, the Grid counter shows the value +5000.
One of my customers would like to allow some users to view the total number of the Case entity records in the application. As this number is larger than 5000 records, the Grid counter is not a viable solution.

One possible solution is the Chart, which usually works in conjunction with the Grid view criteria. In order to set up a chart which counts the total number of records, follow the next steps:

  1. Create a new public/private view to display all entity records
  2. Create a new public/private vertical/horizontal column Chart 
  3. Set the Chart Series to the Count:All aggregation
  4. Set the Chart category to any field which value is common to all records. This may be a field which has no value for all the entity records. If such field does not exist, create it
  5. Save the query and close the Chart editor

The following screenshot demonstrates a chart counting 20,772 records, while the greed counter shows +5000.

image

So how does the Chart count all records while the Grid stops at 5000 records?
While the Grid query for actual data records, the chart uses FetchXML Count aggregation which returns only one data item – the total number of records. Grouping on a field which has the same value (or no value) for all records ensures only one chart category which allow stacking the total number of records in one column. Following is the Chart FetchXML definition:

       <fetch mapping="logical" aggregate="true">
          <entity name="xxx_dailyhourreport">
            <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="xxx_name" />
            <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="xxx_dailyhourreportid" aggregate="count" />
          </entity>
       </fetch>

Unfortunately, this solution is currently limited to a max of 50K records. Thank you, Andrii, for your useful comment.