Another strange problem encountered and fixed today. The form onLoad code “suddenly” stopped working. I say “suddenly” because in fact this was a red herring and the problem turned out to be the result of a change. The symptoms were however unexpected.
Normally when a scripting error occurs in MSCRM, Internet Explorer will throw a script error dialog as the form loads (e.g. “There was an error with this field’s customized event.”):
Or alternatively a warning is shown at the bottom left of the Internet Explorer screen:
But on this occasion, there were no warnings. My first thought was to place a debugger statement into the code, but even after publishing this too failed to execute. I tried a simple alert() statement but this also failed. Odd.
Replacing all the code in the event handler with a simple alert() statement did work, so clearly this was a syntax problem, but very odd that it didn’t throw any error and in fact even blocked the debugger statement. If I were to delve deeper I’m sure I’d find that this is due to try…catch handling within the MSCRM ASPX pages…
Thanks due to Douglas Croxford’s JsLint for speeding the time to resolution somewhat.