Hi,
Most of the time while writing JavaScript in CRM, we end up writing duplicate code i.e.
For e.g. if there are two fields say field1 and field2 and on selection of a particular value in field1, we would like to make field2 mandatory.
Here we would first write the code for that in the onSave event of the field1.
Than again we would have to put the same code in the onload event also to reflect the same condition.
After some time it becomes really difficult to maintain it!
However there is a solution to that, just browsing through stunnware site, got this particular article on reusing Javascript.
Please go through that !!
Reusing code in OnLoad and OnChange event handlers
Just thought of sharing it ….