Pages

Wednesday, November 16, 2011

CRM 2011 Update Rollup 5 form issues

As mentioned previously, CRM 2011 Update Rollup 5 in particular introduces some nice new improvements/enhancements. But also as mentioned this rollup cannot be uninstalled. Or technically it can be uninstalled by essentially uninstalling CRM 2011, restoring a database backup and re-installing CRM 2011 again along with the previous rollups to get back to where you started...

So knowing that this is the case, I came across a perplexing issue which appears to have been introduced by Update Rollup 5 that caused a form to no longer render correctly. The end result was that I was receiving the fairly generic "Error on page" message and as indicated in a former post on the topic, the error seemed to occur even when jscript was disabled. And so - using the same process of elimination technique described in that post - I went about removing snippets of jscript until the root cause of the issue was discovered.

The issue came down to the application ribbon EnableRules in the particular case where the EnableRule references a custom function within the form jscript (as described here).This didn't really seem to make any sense but it was evidently the case as every time the function was removed, the form error went away and vice versa. Delving a little deeper it was determined that if the function was left in but one of the form global variables that was referenced was commented out, the form would once again render properly.

So the conclusion that was reached was as follows:

  • Before rollup 5 it appears the form onload script was executed prior to executing the custom EnableRules functions defined in the application ribbon. This allowed for global form variables to be declared that a custom EnableRule jscript function could then reference.
  • Post rollup 5 it appears that the load order was altered such that the form onload script no longer executes prior to the execution of application ribbon EnableRules functions. This means that any global variables referenced in a custom EnableRule jscript function are undefined and will result in the form error described above.

That's at least what I deduced from the behavior that I observed. This issue was reported to Microsoft but rather than waiting for a resolution (which could take a while) or trying to painstakingly revert to a previous rollup, I implemented a workaround solution which was to essentially do away with the form global variable and rather recalculate the value in the EnableRule custom function itself. Once implemented in this way, the form was happy again.

Needless to say the above issue was perplexing indeed - you know the feeling - where you start second guessing your own sanity... So if you encounter such behavior after installing the above rollup, you may want to look into this as one of the potential reasons for the strange form behavior.


No comments:

Post a Comment