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

Getting the CRM url for Silverlight based on the browser

When creating Silverlight applications the normal method of retrieving the url for the CRM server that will be used to connect to the REST endpoint is usually based on the CRM url that is stored in the CRM config database and retrieved based on Xrm.Page.context.getServerUrl().

There can often be problems with using this address, for instance in development environments or similar, as the address returned might not be the address used in Internet Explorer. When this happens, Internet Explorer will block the connection to the REST endpoint since it does not connect to the same URL as the webpage that hosts the Silverlight application.

During the latest course I held for some CRM consultants at Evry, we discussed this and one of the attendees, Klas Adolfsson at Evry, was very quick and wrote an alternative to the getServerUrl()-method that bases the url on the hosting browser url instead of the url context variable from CRM.

HtmlPage.Document.DocumentUri.Scheme + “://” + HtmlPage.Document.DocumentUri.Host + “/” + App.Current.Host.InitParams[“orgname”];

Edit: There are some relevant comments to this posting below, please read these if this posting is of interest to you.

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

Swedish IRS hacked – shows glitch in responsibilies of online services for government agencies

There is currently rather a lot of media in Sweden about a computer system hosted by a larger Software Integrator outsourced by the Swedish IRS. This system was hacked and about 9000 client accounts were compromised. The discussion in the media is if this a government agency really can delegate this kind of responsibility to a third party or if there will always be some fundamental responsiblity for maintaining the security at the government agency? The security experts and even the Swedish Secretary of IT, Anna-Karin Hatt, indicated that this kind of responsibility could not be delegated.

This question is very relevant in the case of CRM systems in general and Microsoft Dynamics CRM in particular. It would then seem more or less impossible from an government agency CIO perspective to use any kind of cloud based service for line of business systems like CRM/xRM as this would imply that it is impossible to fully maintain the control required over the information in the system. This is no problem for us working with Dynamics CRM as it can be deployed on-premise, but bad news for anyone looking to work with SalesForce.com or any other pure cloud based service as they cannot be used in such conditions.

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