Convergence 2007 Copenhagen

It was a last minute call, but I'm attending the Convergence as well. Please leave a message or send an email if you wish to drink a beer :)

If there's something interesting to share, then I'll make sure it's online as soon as possible.

Also I'll be standing at the Microsoft Product Groups Booth for the MVP Program at the following times:
- Monday 22nd 18:00 - 19:00
- Tuesday 23rd 12:00 - 13:00
- Thursday 25th 10:30 - 11:30

Se you there!



Importing Customizations: Invalid Attribute

Here's an approach for finding a solution to a new error which I haven't discussed before. The error that I will discuss is the message "Invalid Attribute" while importing the customizations. This only appears when there are already customizations imported and you try to import a new version of the customizations file.

I wasn't able to find out information on Google or Partner Source, but managed to find out what was going wrong. The way I found this out, is by using the CRMDiagTurbo tool. You can find this tool on the blog of Benjamin Lecoq: http://blogs.msdn.com/benlec. This tool allows you to do quite some things of which one is to easily enable the tracing for CRM. The way to find the error is to start tracing, perform the import, wait for the error, stop the tracing. You now can go and search in the file c:\CrmDiagPlatformTrace[ddMMyyyy]\w3wp-MSCRMServices-[yyyyMMddhh].log for the string "SOAP Request failed".

This will show you an entry which says:


>SOAP Request failed:
>Url:http://ukauctioncrm/MSCRMServices/ImportXml.asmx
>MethodName:Import
>Response:
><?xml version="1.0" encoding="utf-8"?>
><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Server</faultcode>
> <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Microsoft.Crm.CrmArgumentOutOfRangeException: MaxLength is out of range for 'new_footertext' field. MaxLength: 5000, StringMinLength: 1, StringMaxLength: 4000 ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
>Parameter name: MaxLength is out of range for 'new_footertext' field. MaxLength: 5000, StringMinLength: 1, StringMaxLength: 4000
> --- End of inner exception stack trace ---
> at Microsoft.Crm.Metadata.StringAttributeUIData..ctor(AttributeMetadata metadata, XmlNode xmlProperties)
> at Microsoft.Crm.Metadata.AttributeMetadata.CreateUIData(XmlNode propertiesXml, Organization settings)
> at Microsoft.Crm.Metadata.EntityMetadata.InsertFieldXml(XmlDocument entityXml, Boolean ignoreFieldXmlErrors, Organization settings)
> at Microsoft.Crm.Metadata.EntityMetadata.InsertEntityXml(DataRow reader, Boolean ignoreFieldXmlErrors, Organization settings)
> at Microsoft.Crm.Metadata.DynamicMetadataCache.LoadUIInfo(DataTable OrganizationUI)
> at Microsoft.Crm.Metadata.DynamicMetadataCache.LoadCache(DataSet ds)
> at Microsoft.Crm.Metadata.DynamicMetadataCache.Flush()
> at Microsoft.Crm.Tools.ImportExportPublish.ImportEntityRelationshipHandler.ImportItem()
> at Microsoft.Crm.Tools.ImportExportPublish.ImportHandler.Import()
> at Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.RunImport(String[] ImportEntities, ImportMask Mask)
> at Microsoft.Crm.Tools.ImportExportPublish.ImportXml.RunImport(String parameterXml)
> at Microsoft.Crm.WebServices.ImportXmlWebService.Import(String parameterXml, String customizationXml)
> --- End of inner exception stack trace ---</faultstring>
> <detail />
> </soap:Fault>
> </soap:Body>
></soap:Envelope>


When looking to the faultstring in this soap package, we can see that the new_footertext is causing the problem. Apparently this attribute has been removed in the development environment and been added again with a larger length than the original length. To solve this particular error I have just removed the field from the target system and reimported the customizations file, but since the exact message will differ in your system, you will need to find out what you will do with the attribute specified.

Since the trace file is quite hard to understand if you are seeing this for the first time, you can also use the CRM Trace Log Viewer. This is a tool created by Stunnware (Michael Höhne) which you can download here: http://stunnware.com/crm2/topic.aspx?id=TraceLogViewer

I hope this helps somebody who encounters the same error message.



MS CRM Role Utility

Ever since the Sandbox went down, I've received quite some questions around the Role Utility. Luckily I still had a copy available. For the ease of use I've uploaded this one and here's the link: link.

Have fun



Speaker at Dutch Dynamics CRM User Group

Last week at the 4th of October, there was the first session for the Dutch Dynamics CRM User Group. This session was organized by the Dynamics User Group (http://www.dynug.nl) and hosted by Generali. The goal of this User Group is to get customers together and learn from eachother and have a voice within Microsoft.

The agenda for this meeting was:

- Welcome and Introductions
- User Group and Microsoft
- Microsoft Dynamics CRM Migration
- Break
- Microsoft Dynamics CRM Integration
- Open discussion
- Informal end

The organization has asked me to be the speaker for the topic Migration and Leon Krancher, one of my colleagues, was asked for the topic Integration. The both of us have been guiding the open discussion and answering interesting questions regarding training, user adoption and implementation issues. The presentations will come online on the website for the DynUG for members.

Evaluation of this first session showed that it was a great success. The average of all the attendants thought the sessions were good or very good. The organization, Leon and myself are very happy about this event and are looking forward for the next meeting. I hope to see even more customers by then!



Fetch the ObjectTypeCode based on EntityName

Not a very rocket science, but just something again that I don't want to type over and over again. So here's a piece of code that helps you to fetch the ObjectTypeCode based on the EntityName for CRM 3.0:

private int GetObjectTypeCode (string entityName)
{
CrmMetaDataService.MetadataService metadataService = new CrmMetaDataService.MetadataService();
metadataService.Credentials = System.Net.CredentialCache.DefaultCredentials;
EntityMetadata entityData = metadataService.RetrieveEntityMetadata(entityName, EntityFlags.EntityOnly);
return entityData.ObjectTypeCode;
}


For CRM 4.0 this would be (thanks for the comment Pratima):
private int GetObjectTypeCode (string entityName)
{
CrmMetaDataService.MetadataService metadataService = new CrmMetaDataService.MetadataService();
metadataService.Credentials = System.Net.CredentialCache.DefaultCredentials;
EntityMetadata entityData = metadataService.RetrieveEntityMetadata(entityName, EntityFlags.EntityOnly);
return entityData.ObjectTypeCode.Value;
}


Have fun copy pasting :)