Friday, April 13, 2012

CRM2011 Setup and Upgrade Errors With Resolutions

When upgrading from CRM 4.0 to MS CRM 2011 you might bump into serveral issues, I've listed some of the most normal serarios :)

"Fragmented indexes were detected in the Microsoft Dynamics CRM database",
This might accure during the import of the organizations:

Resolution:
Re-index the organisation databases (A SQL script)

USE MyDatabase
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO

Updating statistics ensures that queries compile with up-to-date statistics

'System.ServiceModel.Channels.ReceivedFault' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b73a53451934e545' is not marked as serializable
Error when testing Email router:

Resolution:
Add the account running the email router services to PrivUserGroup security group.

SQLSERVERAGENT (SQLSERVERAGENT) service is not running on the server ......


Resolution:
· Check if SQLSERVERAGENT service is running
· Open the port 445 for SQL Server


Microsoft.Crm.Web.Reporting.SrsReportViewer.SetExecutionCredentials(ServerReport reportObj) Cannot create a connection to data source 'MSCRM'. (rsErrorOpeningConnection)
The error message gets received when accessing the reports from any of the organizations:

Resolution:
· Add SSRS service account to privreporting group.
· Reinstall the reporting extension again using deployment account.

The process to resolve was as follows:

1. Uninstall the Reporting Extensions.
2. Go to the CONFIG DB (MSCRM_CONFIG) of CRM and update your organization's row in the Organization table to set the AreReportsPublished boolean field to FALSE.
3. Re-install the Reporting Extensions and they should publish the reports again.

Note: You will see the message about installation is republishing the reports again

Unknown labels in settings group

Resolution:
Follow the Microsoft article for resolution: http://support.microsoft.com/kb/2530358.

Happy XRM'ing!

Saturday, April 7, 2012

Startup script Onload AND Onsave! Basic's for every Jscript!

Tired of having XX web-resurces on a form? Well.. Now you can controll everything within one JS with only 1. trigger:
- OnChange
- Onload
- OnSave

as well as:
- For all form types: OnCreate, OnNewForm, onReadonly ++

Read more about this in my previous post: Best javascript startup script ever
/* Script Entry Point */
function OnCrmPageLoad() {
 var FormTypes =
 {
Undefined: 0,
Create: 1,
Update: 2,
ReadOnly: 3,
Disabled: 4,
QuickCreate: 5,
BulkEdit: 6
 }
 runAlways();
 switch (crmForm.FormType) {
 case FormTypes.Create: OnNewFormLoad(); break;
 case FormTypes.Update: OnUpdateFormLoad(); break;
 case FormTypes.ReadOnly: OnReadOnlyFormLoad(); break;
 case FormTypes.Disabled: OnDisabledFormLoad(); break;
 case FormTypes.QuickCreate: OnQuickCreateFormLoad(); break;
 case FormTypes.BulkEdit: OnBulkEditFormLoad(); break;
 case FormTypes.Undefined: alert("Error"); break;
 }
}
/* Implement each Form Type you wish to address */
function runAlways() {
 onchange();
 Xrm.Page.data.entity.addOnSave(addToOnSave);
}
function OnNewFormLoad() {
}
function OnUpdateFormLoad() {}
function OnReadOnlyFormLoad() { }
function OnDisabledFormLoad() { }
function OnQuickCreateFormLoad() { }
function OnBulkEditFormLoad() { }
/******************** OnChange and OnSave functions ***************************/
function onchange(){
 //Skriv inn alle felter som skal ha OnChange
 Xrm.Page.data.entity.attributes.get("prefix_field").addOnChange(Summering);
}
function addToOnSave() {
 var SAVE_MODE_SAVE = 1;
 var SAVE_MODE_SAVEANDCLOSE = 2;
 // Validate only if the user clicked "Save".
 switch (event.Mode){
 case SAVE_MODE_SAVE:
  //Do something for "save"
  if(/*write you check*/) {
   // Cancel the save operation.
   event.returnValue = false;
   return false;
  }
  break;
 case SAVE_MODE_SAVEANDCLOSE:
  //Do something for "Save and close"
  if(/*write you check*/) {
   // Because this is a "Save and Close",
   // just save the form.
   return true;
  }
  break;
 }
}
/*************** End OnChange and OnSave functions ***************************/
/* --------------- Private functions ---------------------*/
function Summering(){
alert("You are inside a function triggerd from a onChange");
}
/* ------------ End Private functions------------------*/