Category Archives: CRM 4.0

CRM AUDITING: SQL Database Standard to Enterprise version

So on MS CRM Audit Log screen we could not see any partition details available even though (as shown in screen print below) even though we are using enterprise version of SQL.


We also realized that our audit table grown very large and was started impacting performance as well, during investigation it is revealed that MS CRM organization was created from back up which was taken from standard SQL version.

So when new organization import process run then CRM system did not created these partition so we contacted Microsoft support and they provided following SQL script for this.

After running script we started seeing CRM Audit partition in the system now.


CRM AUDIT: SQL enterprise to standard version

if your requirement is other way around so your current CRM SQL DB is enterprise version and if you want to migrate to standard SQL version then follow the steps provided in this KB article to restore DB and then after this perform normal import organization operation in CRM for this.

Hope this helps…




Book Review: Packt Microsoft Dynamics CRM 2011 Reporting

I have been asked me to  review the Microsoft Dynamics CRM 2011 Reporting written by Damian Sinay


The reviewers for the book are:

Overview and Structure of the Book

The book is 308 pages and the chapters are:

  • Preface
  • Chapter 1: Introduction to Reporting in      Microsoft Dynamics CRM
  • Chapter 2: Database Basics
  • Chapter 3: Creating Your First Report in CRM
  • Chapter 4: SQL Server Report Builder
  • Chapter 5: Creating Contextual Reports
  • Chapter 6: Creating Inline Reports
  • Chapter 7: Using Reports and Charts in      Dashboard
  • Chapter 8: Advance Custom Reporting and      Automation
  • Chapter 9: Failure Recovery and Best Practices
  • Chapter 10: Mobile Client
  • Appendix : Expression Snippets



This book covers all different options available for CRM reporting and provides good grounding in CRM reporting aspects so any users/developers want to learn/understand CRM reporting better this is book for them.

Chapter 1: Introduction to Reporting in Microsoft Dynamics CRM

The first chapter explain different types of reports available in CRM and also explains installation procedure for CRM 2011 connects and Reporting authoring extension.

SQL reporting service version sections (page 15) explains different SQL server version compatibility with SQL Server and CRM server and states that SQL Server 2012 is not compatible with Visual studio 2012 for CRM 2011 Reports. I guess this was correct at time of book writing but since then Microsoft released update of SQL Server Data tools and after this update Visual studio 2012 can also be used to develop CRM reports for SQL Server 2012.

Chapter 2: Database Basics

This chapter explain basic and advanced commands of SQL Language and also FetchXML Language. All the dynamics CRM views are created with this FetchXML language and users can now write reports in CRM 2011 using this language as well.

 Chapter 3: Creating Your First Report in CRM

This chapter takes you through step by step guide on how to create report in CRM using CRM reporting wizard and then how to modify that report in SQL Reporting Service Project.

Chapter 4: SQL Server Report Builder

This chapter explains step by step guide to create report using SQL Report Builder which comes with SQL Reporting services. SQL Report Builder can be used by intermediate user to develop CRM reports.

Chapter 5: Creating Contextual Reports

This chapter looks at advanced tools (visual studio) to create CRM report and this chapter also reviews CRM report parameters and chart controls.

Chapter 6: Creating Inline Reports

This chapter looks ate crating embed report on CRM entity form. It creates HTML web resource to achieve this functionally and chapter also explains how to create/update this HTML web resource. 

Chapter 7: Using Reports and Charts in Dashboard  

This chapter explains process of integrating report in CRM dashboard and CRM charts (i.e. new feature in CRM 2011) basics.

 Chapter 8: Advance Custom Reporting and Automation

This chapter explains how one can integrate a custom ASP.NET or Silverlight application to show a dynamic or more sophisticated report inside Dynamics CRM 2011

Chapter 9: Failure Recovery and Best Practices

This chapter looks at how one can troubleshoot different issue arising while working with reports in CRM 2011. Quick rightly these details were need as user will tend to hit these issues while developing CRM 2011 report. This chapter also focuses on performance enhancement and SQL Reporting Service Best practices.

Chapter 10: Mobile Client

This chapter explores CRM reports on different mobile devise like iPhone, iPod and Microsoft Surface and also explains process of configuring IFD authentication with CRM.

Appendix: Expression Snippets

This section explores basic expression and their usage in reports and how can you add external code, variable and assemblies in report.

Final Verdict

Provided that we already have Dynamics CRM books but I guess each book generally dedicates chapter or two for CRM reporting only while this book is specifically for CRM reporting which is really good.

And although this does not cover all types of reports (i.e. matrix reports, SQL advanced chart type reports) related to CRM it does cover lots of details related to CRM report So if you are just started work in CRM reports or working in CRM reports but want to know more about it this is definitely book for this.

If you are interested in buying above book, here is link for this.







CRM : Rescheduling the Update Contract States job

Update Contract States job is CRM 2011 (also for CRM 4.0) system job which runs daily and change the contract status based on contract start date and end date (i.e. change contract from Invoiced to active and from Active to expired).

One of customer’s CRM organization has this job running 10 PM at night and wanted to change this job on particular time (very early in the morning) to make sure contract status are up to date when users starts using CRM system.

There is job editor provided by MS to reschedule CRM system jobs but this does not include this specific job.

so following are steps we undertook with the help of CRM parter/MS support to reschedule this particular job in CRM system.

Step 1: run the following query to find the current Jobs in the relevant CRM organization. (note down the AsyncOperationid returned from this query as we will be using this in next step)

select AsyncOperationid,RecurrenceStartTime,postponeuntil,StatusCode, RecurrencePattern from AsyncOperation WHERE
Name = 'Update Contract States job'
StatusCode =10
and RecurrencePattern is not null

following quick details regarding important columns in this table.

RecurrencePattern is used to describe frequency and interval of the system jobs and please refer this article for more information on regarding this.

Postponeuntil is datetime field and indicate when this job will run next time. And it is UTC date meaning if this field contains “2012-10-23 09:08:00.000” and if your time zone is GMT + 1 then this job will run next time on “2012-10-23 10:08:00.000”

RecurrenceStartTime is also UTC datetime field which will be used to set next runtime of job, date part of this field is not important as long as it is set in the past.

Step 2: so using noted down AsyncOperationid in step 1 run following query to update recurrencestarttime, postponeuntil for this Update Contract States job .

update AsyncOperation set
RecurrenceStartTime = '2012-10-22 09:08:00.000',
postponeuntil = '2012-10-23 09:08:00.000'
WHERE AsyncOperationid = '5EB24ECB-60ED-4F59-801D-A6C19465C4D8'

So as per above update, this job will run at 9:08 AM (GMT time) in the morning every day.after job run if you verify the details then it would look as follows. So as you can see system will update postponeuntil (next run time) to next day (24th October) after this job run today (on 23th October).

****Important Notes regarding above change****
above change is unsupported so make sure you apply this change to Dev, Test environment before applying this to Live environment. Also make sure you take back up of database before doing this change.

Hope this helps..


How to find records created on weekends or created on after working hours

Recently one of our customer asked how to find cases or emails created on Saturday/Sunday or cases created after normal working hours (i.e. after 18 PM?).

Of course this CRM system had email router which were creating those email and automatic case were created based on this.

I did try to so this using advanced find but it is not possible to get the desired result and try to do this using Excel features and it was really easy, following quick steps for the same using Excel.

Step 1: Export data to excel, so do advanced find on CRM (CRM 4.0 or CRM 2011) to retrieve relevant data and then export that to excel.

Step 2: once exported add new columns, let’s say those columns are called “DAY”, “Time HOUR” and “Time MIN”.

Step 3: put formula to retrieve values for those columns, as shown below. Please note that column G is created on date and based on this column G following formula are created. Please change column name as per your requirement.



COLUMN J (Time Hour):
COLUMN K (Time Hour):

Step 4: after apply this formula to all rows and you will get following result.

Step 5: you can apply standard excel filter to return only cases created on weekends (Saturday/Sunday) or cases created after 18 PM easily.

Hope this helps…


Getting View Details from CRM Grid (CRM 4.0 vs. CRM 2011)

We had custom application which uses were passing selected view id to our custom web page in CRM 4.0, following code we put in JavaScript button click event to retrieve this details.

if (top.stage.crmGrid != null)
var sViewId = top.stage.crmGrid.GetParameter('viewid');
var sViewType = top.stage.crmGrid.GetParameter('viewtype');
var sOtc = top.stage.crmGrid.GetParameter('otc');

Above code does not work in CRM 2011 and by doing really simple change as mentioned below, so following code works fine for CRM 2011..

if (document.getElementById('crmGrid') != null) {
var sViewId = document.getElementById('crmGrid').GetParameter('viewid');
var sViewType = document.getElementById('crmGrid').GetParameter('viewtype');
var sOtc = document.getElementById('crmGrid').GetParameter('otc');

Hope this helps..

Note: This is unsupported customization, Please unit test this module on your development/test environment before applying it to Live Environment.


CRM Outlook client Installation issue

One of my colleagues had following issue while installing latest CRM roll up for outlook client.

Installation cannot proceed: Setup cannot continue because a pending restart is required. Restart the computer and then try running Setup again

Please read this article for the solution regarding this.

Hope this helps…

MayankP 🙂

CRM 4.0 Printing Error – This form has been changed and must be saved before printing.

One of user posted this error in this CRM thread, we had similar issue some time back and one of my colleagues had resolved this issue.

This error comes if you got java script code which is constantly updating some variables in the back ground. This makes CRM Form engine believes that form has been changed so CRM print function will not allow you print CRM form.

The solution for this is that we over ride existing CRM print on click event and write function to run this print job manually.
Following is example script for Phone call entity. This script needs to put in to the Form On Load Event.

Following text version of above code, change the object type code as per your requirement.

if (document.getElementById('_MBcrmFormPrint') != null)
document.getElementById('_MBcrmFormPrint').action = ' openStdWin(prependOrgName("/_forms/print/print.aspx?objectType=4210&id=" + crmForm.ObjectId + "&title=" + CrmEncodeDecode.CrmUrlEncode(parent.document.title))); ';

Hope this helps!!

Note: – This is unsupported change so please make sure you take necessary back up before doing this change.

MayankP 🙂

CRM 4.0 Email Tracking Issues

Recently we started getting following errors in CRM 4.0 outlook client while tracking any email or setting regarding for any email in outlook.

Error 1
“An error occurred promoting this item to Microsoft Dynamics CRM. The Microsoft Dynamics CRM server count not be contacted or the user has insufficient permission to perform this action”

Error 2
“The Requested record was not found or you do not have sufficient permission to view it”


Based on this KB Articles , following are steps to resolve this issue.

Step 1: Clear the outlook cache as specified in following screen print.

Note: these steps are for outlook 2010.

Step 2: clear down IE Temporary files as mentioned in following steps.
1.Open IE- > go to Tools -> Click Internet Options
2. On Browsing history section, click on Delete and then delete all the IE temporary data.

Once above steps are done, close your outlook and then start again.

Hope this helps!!!

MayankP 🙂

Microsoft Community Contributor Award

Last Month, I was honoured to receive recognition by Microsoft for contributions to the Microsoft online technical communities with the Microsoft Community Contributor Award.

Thanks Microsoft and to you who nominated me!

Additional information about the Microsoft Community Contributor Award Program can be found at

MayankP 🙂

CRM 4.0 Issue: IE window display full path in Title bar

Suddenly few of our CRM user started seeing full path in CRM IE Title bar.

After little trial and error method we found that issue was cause by change in Domain Policy and to fix this issue on individual users system we did following steps…

Step 1: open IE -> Tools -> Internet Options

Step 2: go to security tab

Step 3: select Local intranet/trusted sites deepening upon where your CRM sites are added

Step 4: Click on Custom Level

Step 5: and the go to the Miscellaneous section and find option called “Allow script-initiated windows without size or position constraints”

Step 6: Select Enabled and click Ok

Step 7: Restart all IE Sessions and this issue will be fixed.

Hope this helps,

MayankP 🙂