I wrote this script for CRM 4.0. It worked when we upgraded to 2011 but now that we made the change to 2013 we are having issues. I have updated the code to work with 2013 but we are still receiving an error message when the form loads. Basically it is supposed to enable access to a client's folder within windows explorer from the account from.
Below is the code:
function Form_OnLoad()
{
if (Xrm.Page.getAttribute('new_folder").getValue() != null);
{
var clientfolder = Xrm.Page.getAttribute("new_folder").getValue();
document.getElementById("new_folder").style.color = "#DF0001";
document.getElementById("new_folder").style.textDecorationUnderline = true;
document.getElementById("new_folder").style.fontWeight = "bold";
document.getElementById("new_folder").onclick = function();
{
window.open(clientfolder);
}
}
if (Xrm.Page.getAttribute('new_orgchart").getValue() != null);
{
var orgchart = Xrm.Page.getAttribute("new_orgchart").getValue();
document.getElementById("new_orgchart").style.color = "#DF0001";
document.getElementById("new_orgchart").style.textDecorationUnderline = true;
document.getElementById("new_orgchart").style.fontWeight = "bold";
document.getElementById("new_orgchart").onclick = function();
{
window.open(orgchart);
}
}
}
Everything is correct in the form properties with respect to Form Libraries and Event Handlers as well as within the Field Properties but we still continue to receive the error message found below.
There was an error with this field's customized event.
Field:window
Event:onload
Error:'Form_OnLoad' is undefined
Any help would be greatly appreciated.
Thanks