JavaScript Upgrade Strategy #10: Convert Unsupported Code

Again, since we are in refactor mode, now is the time to fix all of your previous decisions.  Some, or in some cases, many of those decisions involved using unsupported JavaScript.

In the days of Dynamics CRM 4.0, we had to do a lot of unsupported code to provide the responsive user experience we needed for a particular customer or project.  When I created Transformer!, the main goal was to convert all of the unsupported code that could be converted, into fully-supported code.


And, there are different levels of unsupportability, which I break down into these categories:


Mildly Unsupported

Things like showing and hiding fields – the most common of our unsupported methods.  You may also consider things like adding click or double-click events to form elements to be in this list.

Most of these things either convert directly to the new Xrm.Page model or are no longer necessary because of changes to the form handling processes or design made them unnecessary.


Fairly Unsupported

Manipulating the JavaScript Domain Object Model (DOM) to add, remove or move controls.  This type of code will probably not work after Dynamics CRM 2011 Update Rollup 12, since the form layout changed.


Really Unsupported

The use of undocumented methods and variables can leave you with entire sections of code that must be rewritten because the unsupported code you are using no longer exists.


Cross-Browser Issues?

When Dynamics CRM 2011 first shipped, this was not much of an issue because you were pretty much required to use Internet Explorer.  After the release of Dynamics CRM 2011 Update Rollup 12, we were given the ability to use other browsers.  Dynamics CRM 2013 continued that practice so that we can currently use IE, or Chrome, or Firefox, or Safari without issue.

You just need to make sure your JavaScript follows the Xrm.Page model and doesn’t have anything that is specific to a single browser.


Where do I look?

Take a look through your code-base to see if you have any of the following:

  • Do you utilize ActiveX components?
  • Are you using JavaScript events?
    • onclick
    • ondblclick
    • etc.
  • Are you manipulating the DOM directly?
  • Are you accessing the 2007 SOAP endpoint?


These areas need to be either rewritten or re-architected, depending on the circumstances and the code used.

Leave a Reply 0 comments