There is light in the tunnel however, by using the technique specified bellow, you can both
So, first of all we have to put some standard code in the onLoad. This should only be done once and it shouldn't really be changed until you need to publish it for release (switching of the caching).
var LoadFile = function(url, cache)
var httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
httpRequest.open("GET", url, false);
httpRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
So, copy-paste it into the onload event form in the account form editor in CRM. Activate the event, save and publish.
Then you can create the two .js-files at the specified directory. Start with just some test code like:
alert("This is the MyGlobal.js-file");
or something similar.
The next step is to try to avoid using the onsave and onchange events. This is quite easy when you know how but it is sort of in the gray area of supported customizations so be aware of this.
In the file Account_onload.js add the following code:
var MyOnSave = function()
var MyOnChange = function()
This attaches a simple function to the onsave event of the form and another to the onchange event of the attribute "name".
The functional defintions/declarations can be put into any of the includefiles.
Now, just save the file, and open an account to see the magic! (It should show a dialog when loading with the text "onload", when the accountname is changed, it should show "onchange" and when saved, it should show "onsave".
Microsoft Dynamics CRM Architect