How to Include JS files in CRM 3.0
I encountered a problem while customizing a CRM 3.0 implementation for a client.
The problem was that the project required a lot of JavaScript and if you have been working with CRM 3.0 you already knows how frustrating it is to develop using JS within crm.
In order to remedy that problem, I thought of using a custom .JS file and include it in the forms that I was customizing. Microsoft clearly states modifying the CRM source pages is not supported or recommended and may not survive an upgrade or a patch.
Here is my solution that may help us all in future CRM 3.0 client side development.
1.
Create your .JS file.
2.
Place it either in a new Virtual Directory within the CRM website or as a separate website all together.
3.
Select the entity that you want to customize and enable the OnLoad event.
4.
Put the following code within the event:
var script = document.createElement("script");
script.type = "text/javascript";
script.src= "[the location of your script either relative or absolute]";
socument.getElementsByTagName("head")[0].appendChild(script);
5.
At this point the .JS file has been appended to the page and has been subsequently loaded by the browser.
***Please note that any modifications to the JS file will require you to clear the browsers Temporary files, otherwise it will not load the latest version. ***
*** this has not been tested for CRM within outlook. ***
Have a great day.
Oshri Cohen
Labels: crm 3.0, customization, development, Javascript, Microsoft, Simboliq
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home