Unsupported customizations

Unsupported customizations are certain customizations that fall outside of what is supported by Microsoft when developing and customizing for Dynamics CRM. Several aspects of this subject can be discussed in depth and I will try to touch base on some of them.

When creating Microsoft Dynamics CRM, Microsoft realized something very important, the system will need to be customized by partners to fully fit the needs of the customers. However, customizations need to be upgradable and support update rollups and hotfixes. Previously, all upgrades would require rather large efforts in re-writing lot of the code that was custom built for the customer. However, the definition of supported and unsupported customizations and the promise from Microsoft that all supported customizations will be upgradable and updatable at least to the next version, is something that is very good and will ensure a better return of investment of the custom development made for customer and also improve partner-customer relations since paying for upgrades of already made customizations seldom improves the partner-customer relationship.

We have worked with many systems where other consultants and developers have created solutions and here are some of the more common unsupported customizations, why they will cause problems and alterntive solutions:

HTML DOM addressing and modifications
Addressing HTML DOM components directly using document.getElementById and replacing parts of the normal HTML DOM with custom components. For instance, addressing an isv-button in CRM 4.0 and disabling or removing it with javascript. Another example is replacing lookups with dropdows, for instance letting the user select contact for an opportunity.

This is very common i CRM 4.0 but is also quite common in CRM 2011. The problem with this unsupported customization is that when upgrading the system the names of the elements in the HTML DOM will probably change. This is obvious in the case of isv button addressing in CRM 4.0 since the ribbon HTML DOM element names are different. The code will hence break after an upgrade.

Developers doing these kinds of unsupported customizations are usually web developers that are used to being able to modify webpages with javascripts anyway they like and they are not familiar with the SDK and do not forsee the consequences of these unsupported customizations.

Alternative solutions are to strictly use the object model described in the SDK and only use the documented methods. Note that the SDK in CRM 2011 has been improved a lot in this perspective. It is also possible to enable and disable buttons in the ribbon with ribbon customizations. It is also possible to use small iframes with aspx-pages behind (or virtual pages created with javascript) that show custom logic and work with the CRM form using cross-frame scripting. Do note that the hosting application and the cross-framed page need to be in the same security zone in IE for it to allow this. Preferably place them on the same server.

Database modifications
Modifications to the CRM database are also some of the more common unsupported customizations that I have experienced. It can be anything from custom views to new stored procedures or even modifications to the existing procedures. Do note that creating indexes in the database is supported but not upgradable.

Developers making these kinds of customizations usually do not realize the effects that they have and might be used to and very familiar with writing T-SQL. Modifications to the existing tables and views are very hazardous since CRM is a metadata driven application meaning that the database contains metainformation on how the database looks. If the metainformation gets out of sync with the real database, you will have a very nasty problem on your hands.

Additions to the database, without any modifications, will usually work with updates to the system. However, when upgrading or redeploying the system these usually cause quite a lot of problems. It is also a general recommendation to try to keep all business logic in the same layer of the application and to not mix them between the database and higher layers (like plugins). This can sometimes not be avoided however.

So, if you do need to create some custom views or similar, create a database next to the CRM database with hosts these and use cross database addressing to work with the data.

Modifications to CRM files or additions to the CRM installation directory
As the aspx-files of CRM can be found in the CRMweb directory (or inetpub for port 80 installation) it can be tempting to modify these. In CRM 4.0, when there was no support for javascript includes, modification to the file global.js was also quite common. I have also seen systems where entire IIS virtual directories have been set up in the assembly directory of CRM. This is also unsupported.

The reason these customizations should be avoided is that any update rollup that is installed might overwrite these files and you customization might be lost. With upgrades the customization will most certainly be lost or stop working.

There are no good alternatives to these kind of modifications. Try working with Iframed custom pages using cross-frame scripting if possible. Modifications to the global.js are very hazardous since it is not very uncommon for it to be updated in normal update rollups, making any customizations to it rather hard to maintain. This is not necessary in CRM 2011 as the web resource-functionality allows for better reuse of javascript code.

Unsupported customizations are necessary anyway
If the requirement still demands unsupported customizations, and there is no good way around it, I recommned having a discussion with the customer on the effects of creating unsupported customizations in regards to upgrades and increased maintainance costs. If the still feel it is required, I recommend you getting their formal signature on a document describing it as an unsupported customzation and that the customer understands that the function might not be upgradable and that upgradecosts will be fully charged to the customer. It might feel a bit formal, but trust me, when the customer wants to upgrade, you will be happy you have the document.

Another important aspect that you need to remember when creating unsupported customizations, is that you need to take this fact into account. For instance, if addressing an HTML DOM element, make sure to handle the fact that it might not exist, and have some resonable fallback from this.

It is also essential to document each unsupported customization with extra care. I recommend a special document for this. It should include some of the following topics:

  • Description of requirement
  • Technical desciption of the solution
  • Why it has to be made with unsupported customizations – This is important as newer versions of CRM might enable you to rewrite this in a supported manner.
  • Possible effects on an installation of an update rollup –
  • Possible effects after an upgrade
  • Checklist to verify the functionality.

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Managed or unmanaged solutions – and how to remove attributes from managed solutions

My colleague Rickard and I are working with one of our customers who have gotten managed to get themselves into a rather big mess with huge numbers of attributes on the account entity that should not really be there. If any of you ever wondered what the limitation for number of attributes in Dynamics CRM is, it is around 700 and it is not recommended to use since the system becomes very hard to work with. Proper data modelling with experienced architects is usually a good idea that pays off tenfold later, so that you do not get your self into this situation.

However, the production system at hand has several hundred attributes that were erroneous in a managed solution, and something had to be done.

The first thing you might think of trying is just to remove the attributes from the development environment, packaging a new version of the managed solution and overwriting the production environments managed solution with this new reduced solution. This will, however, not work, as solutions cannot remove attributes (they contain the state of the CRM-system, not the transactions).

After a few more ideas had been tried, we finally registered a support case with Microsoft where a very helpful technician assisted us with a solution to this, based on this very good blog posting by Gonzalo Ruiz. The latest news on this is that it seems to be working, although neither Rickard nor myself is doing the actual work.

This has also caused us to have a very in-depth discussion on if managed solutions are suitable for normal project production systems or not. I had a discussion with former Microsoft employee Peter Björkmarker who is a very skilled architect, and we came to the conclusion that managed solutions are really best suited for ISV-packages, and not so much for normal customer projects where unmanaged solution are easier to work with. This is, however, something I would be more than happy to discuss, so if you have any opinion on the subject, please leave a comment!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Problems uploading customizations/solutions can be due to large Templates included

Today I am working with a customer who has used other CRM consultants previously. It is always interesting. In this case the QA/testing environment was not up to date and wasn’t acutally working at all. All changes had been made directly in production, not really my cup of coffe, as I like things to be a bit more controlled. Just for the record, it is a CRM 4 system, but the I do believe the same issue applies to CRM 2011 aswell.

So, I wanted to get the QA-environement up to date with the production environment and started by exporting all customizations from production and attempted to import them into the QA-environment. (Backing up that enviroments customizatons first of course). Well, that didn’t actually work, and I didn’t get a very good error message, just some non-descript error. When looking in the event viewer I got a ASP.NET error saying that “Post size exceeded allowed limits.” which of course go me thinking about the size of the customization file. Checking it, I found that it was almost 9 MB, which is above the set  8 MB ceiling. After some pondering about which parts of the customizations might be the issue, I found that the Templates part was about 7.9 MB. So, my suggestion is to keep this in mind especially when exporting customizations/solutions from production systems that Templates can be very large and might brake the maximum transfer size of 8 MB. This maximum size can be changed, but that is another issue.

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Unable to upgrade CRM 4.0 database more than once

My colleague Rickard had an interesting problem yesterday when working with a client of ours. They had a prototype upgrade and now wanted the production upgrade. However, they wanted both of these organizations to be available (yes, will required an Enterprise license or separate SPLA licensing if it is a hosting environment). The prototype upgrade they want to be available as “orgname-old” and the normal upgrade just as “orgname”.

An interesting issue arose when Rickard tried to import the CRM 4.0 database into the CRM 2011 environment he receive an error message saying that a CRM 4.0 database can only be imported once into a CRM 2011 deployment. This might be noted somewhere but it is not something that I or my colleague Rickard have ever seen when working with CRM and we didn’t find to much about it googling the issue either.

The problem seems to be that Microsoft seems to have cut a corner when upgrading a CRM 4.0 database in comparison to normal redeployment as it does not give the organization a new GUID. Hence you cannot import two organizations twice.

The workaround is, however, quite simple, upgrade the first database, disable it and remove it from deployment manager (do not delete it from the SQL-database).

Upgrade the second database into CRM 2011. As there is no organization with this GUID now, this is no problem.

Now, import the first database (redeployment) that you previously disabled and removed from deployment manager. You can now give it a new name if you like. As this is a redeployment, it will give this a organization a new Guid and the two organizations will not conflict.

If you are creative you can probably think of you own solution using similar techniques.

Big thanks to Rickard for input to this posting!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Javascript in CRM 2011 – lots of new stuff

Javascript in CRM 2011 – lots of new stuff

CRM 2011 brings lots of new technology, one of the areas being web resources, a very longed for area where general resources like webpages, javascript libraries and silverlight applications can be uploaded in a general area and then selected in certain areas.

Microsoft have also revised the javascript framework for CRM 2011 and it brings a lot of enhancments and and some old stuff has been depracated, but still works.

I found a very interesting grid at this blog: http://inogic.blogspot.com/2011/02/difference-between-crm-40-and-crm2011.html

I have referenced it directly for your pleasure bellow, click it to view it in full size:

Great thanks to the guys behind it at Inogic. A great help!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se

Need to approve email addresses in CRM 2011

Need to approve email addresses in CRM 2011

As we are running CRM 2011 as dogfood, I found an interesting new feature of CRM 2011. When adding a new user, you have to approve their email for it to work properly, for instance in Outlook where you otherwise will get an error saying that the sending user does not have an email address.

So, if you get this error, just add an email address and press the “Approve Email” button in the ribbon.

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se