Wednesday, May 30, 2012

The view: "Products in Parent Price List" is gone!?

This article talks about a parent look view which is never visible after the “Display search box in lookup diaglog” is checked while customizing Opportunity Product Entity in CRM 2011. There is an easy workaround to get back to old view.

How do I revert to old view?

If you’re thinking that you can just go and uncheck. No then that’s not a solution. We will need to revert through a customization tweak. The reason for this and by now CRM has reset the view id. Hence it shows a different view.
The following are steps to achieve that
  1. Go to Settings > Solutions
  2. Add new Solution and provide a valid name to it.
  3. Save the solution.
  4. Now add existing entity, “Opportunity Product”
  5. Export the solution as unmanaged
  6. Open the unmanaged solution in notepad and locate the following:
  7. Replace {8BA625B2-6A2A-4735-BAB2-0C74AE8442A4} with {BCC509EE-1444-4A95-AED2-128EFD85FFD5}
  8. Save the changes
  9. Zip the files and import the solution back to your environment
  10. Publish the customizations
  11. Refresh the CRM in your browser
  12. You will see the correct view.
Tip: The GUIDS in step 7 could be found in the DB or in the URL of a "clean CRM" dialog for opportunity lookup

Happy XRM'ing!

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------------------*/