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…
In the end, the problem was caused by an htmlEncoded chevron character which had somehow been pasted into the javascript code (< ) while setting up a for loop.
Thanks due to Douglas Croxford’s JsLint for speeding the time to resolution somewhat.
in my case the JavaScript in onload event stopped working suddenly , and now the simple alert() statement is not working also.
does anyone know how to get it working again.
A few things to ask before trying to answer your question:
Is the event enabled via the checkbox at the top of the screen in the event handler dialog box?
Is there any other code in the onLoad event for your form?
Have you published your changes for that entity?
Does it affect all entities or just one entity?
Have you modified any of the MSCRM files (e.g. global.js)?
Does the problem occur on just your own machine or on all client machines? (aka is it an Internet Explorer setting?
Best wishes
Greg