Monday, July 30, 2012

CRM 2011 Error Creating New Organization

You get an error while creating a new organization in CRM 2011.
A non valid page number was received: 0 is displayed on the screen.
The CRM Log is showing the following error message.
Error| System.Exception: Action Microsoft.Crm.Tools.Admin.PopulateDependencyNodesAction failed. ---> Microsoft.Crm.CrmException: A non valid page number was received: 0
 at Microsoft.Crm.BusinessEntities.PagingHelper.AddPagingFilters(EntityExpression entityExpression)
 at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, ExecutionContext context)
 at Microsoft.Crm.BusinessEntities.BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context)
 at Microsoft.Crm.ObjectModel.DependencyNodeService.CreateDataNodes(Int32 componentType, ExecutionContext context)
 at Microsoft.Crm.ObjectModel.DependencyNodeService.CreateAllDependencyNodes(ExecutionContext context)
 at Microsoft.Crm.Tools.Admin.PopulateDependencyNodesAction.Do(IDictionary parameters)
 at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
 --- End of inner exception stack trace ---, Error, RetryCancel, Option1
This error occures if you for some reason have enabled the registry key TurnOffFetchThrottling in the CRM server.
To be able to create the organization, set registry key value to 0 when you get the error message and then hit retry this will get you trough the new organization wizard in CRM 2011 Deployment manager.
I have confirmed that this issue is still occur in CRM 2011 Rollup 8
I hope this is helpful.

Friday, July 27, 2012

Convert Entities to Managed Solution Fails

After Microsoft CRM 2011 Rollup 6 you might be facing a problem when you try to import a solution as managed where the target system contains those entities as unamnaged.

The process of converting entities to managed solution fails if you have custom attributemaps.
The error you get is similar to the following.
Found 1 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = 6d680c43-f66c-e111-a4d0-005056b20fcf, type = AttributeMap, requiredcomponentobjectid = 58765635-f66c-e111-a4d0-005056b20fcf, type= EntityMap, solution = 559bf67b-6e7a-4b68-a4a2-efa4b8fffdd1).
This scenario can happen after you upgrade from CRM 4.0 to CRM 2011 and you have your ISV solution in CRM 4 that you now want to be a managed solution in CRM 2011.

Consider this scenario:
You have a system with entity E3 and entity E4
Entity E3 is the parent of entity E4
The N:1 relationship contains an attribute mapping between the name fields
If you first install this solution as unmanaged, and then try to install it as a managed solution the conversion to managed solution fails on the dependency check
With an error simular to this:
Found 1 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = 6d680c43-f66c-e111-a4d0-005056b20fcf, type = AttributeMap, requiredcomponentobjectid = 58765635-f66c-e111-a4d0-005056b20fcf, type= EntityMap, solution = 559bf67b-6e7a-4b68-a4a2-efa4b8fffdd1).
To reproduce the issue take the following steps:
Step 1: import the unmanaged solution and publish all.
Step 2: delete the solution,(not the entities) so you can import the managed solution.
step 3: import the managed solution.
Result: This fails. (Before Rollup 6 it works)

You use these solutions at your on risk! Make sure you try it out first in a dev environment so that you can confirm you get the result you want from it. Always make sure you have backups!

Solution 1
If you remove the attribute mappings from the managed solution the import works in your environment.
Drawback: If you want to continue to install new versions of you managed solution in to the target system it will fail if you have attributemappings in the managed solution.

Solution 2
Remove the custom attributemaps in the target system from the entities you want to convert to managed.
Import the managed solution without your custom attributemaps.

Edit the solution.xml in you file to comment out the extra attributemaps and then create a new

Once the entities is converted to managed you can do a second import this time with your custom attributmaps.

Select overwrite customization

From now on you will be able to import new versions of your solution without making any changes to the attributemaps.

Drawback: You need to know some XML and be careful!

Monday, July 23, 2012

An Error Occurred in the Script on This Page

An error occurred in the script on this page in CRM 2011.

You might have users that are complaining about Script errors suddenly appearing in Microsoft Dynamics CRM 2011.

The Script error messages looks similar to this.
An error has occurred in the script on this page
Do you want to continue running scripts on this page?

This can occurre after you install a CRM 2011 Rollup.

To get rid of this script error you just need to delete your temporary internet files in
Internet Explorer

Open Internet Explorer
Go to Tools / Internet Options
click on Delete under Browsing history and make sure Temporary Internet files is checked as the image below shows

The rest can be unchecked so you don't lose any other things you might want to preserve.

As a best practise you should always remove Temporary Internet files after you install Microsoft CRM 2011 Rollups as Microsoft also recommends in their KB Articles for Rollups.

I hope this helps :)

Friday, July 20, 2012

CRM 2011 Email Router emailaddress utf-8?Q?

Display name in emails sent with CRM Email Router in CRM 2011 might be showing utf-8?Q? instead of non-ASCII chars
You might see utf-8?Q? instead of non-ASCII (å,ä,ö) chars in the from or to field when you send Emails from Microsoft CRM 2011 with the Email Router the problem is in System.Net.Mail.MailMessage.
There is a hotfix from Microsoft available to fix this issue:

Friday, July 6, 2012

Email Router Not Promoting BCC Emails

Microsoft Dynamics CRM Email Router is not promoting emails if the email address to be matched on is only in the bcc filed.
An event similar to the following is logged in the Application log.
#35241 - The recipients for the e-mail message with subject "your email subject" in mailbox did not match any known records.
One customer noticed that they did not get their emails into the CRM queue if the sender just put their email address in the bcc field.
I did not find any clear information regarding this behavior anywhere so i opened a case with Microsoft Support.
Apparently this is by design. The reason for this is that there is no information about the bcc address in the message header of the email so the email router is not able to match based on the bcc.
The same is true if you promote emails from Outlook to CRM
You can do a workaround by making an incoming email rule that redirects your incoming email where your email address is only in the bcc field to you mailbox. This way your email address appears in the to field, and the promotion of the email works.
The rule would look something like the image below.
Thank you Microsoft Support :)