Create a sub virtual directory under MS CRM Virtual root directory and place your .JS files in sub virtual directory.
E.G.,
Name of the sub virtual directory under MS CRM Virtual root directory is: "Customizations".
and Name of the JavaScript file you have created is "Account_Entity_Customizations.js"
Go to
Settings => Customizations => Custom Entitites => Select Account Entity => Open (double click) => Forms and Views => Form =>Form Properties => Edit OnLoad Event.
Copy paste below code in the OnLoad Event Box (select enable javascript event check box):
var oScript_Account = document.createElement("<script src='/Customizations/Account_Entity_Customizations.js' language='JavaScript'>");
document.getElementsByTagName("head")[0].insertAdjacentElement("beforeEnd", oScript_Account);
Save and Publish the Entity.
Refresh MS CRM Portal.
Open Account Entity, you will see your JavaScript code working.
Happy Coding !!!!!!!!!!!!!!.
1 comment:
Hi ,
thanks for share information.
Actually , there is un acceptable situation for inject javascript to page load event.For example , If your javascript library is huge (bigger than 40 kb size) sometimes your code block is not register to page load.If you want to access your function (your function must be in your js file) maybe you can recieve error!
era
Post a Comment