Microsoft released a beta version of MS Dynamics CRM that supports multiple browser types, but this also includes significant changes that will influence a great number of users and organizations that use Microsoft Dynamics CRM.
Even though Microsoft provides code samples and documented best practices to simplify development and facilitate future CRM upgrades, it doesn’t stop users from facing the problems with breaking customizations and solutions that don’t work anymore. Only solutions that have been created with the help of supported APIs for CRM 2011 as documented in the Software Development Kit for Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online will continue to work without issues. But what if your solution use unsupported methods?
Of course you can use Microsoft Dynamics CRM 2011 Custom Code Validation Tool, however it only highlights the problem, and it doesn’t provide a solution.
Below you can find some examples how problems that have been identified with the help of Microsoft Dynamics CRM 2011 Custom Code Validation Tool can be solved using JQuery and new SDK.
It was | It should be now |
---|---|
insertCell | $("<tr>").appendTo |
document.all | $(element) |
attachevent | $(element).bind |
innerText | $(element).text |
FormType | Xrm.Page.ui.getFormType() |
crmForm | Xrm.Page |
AddParam | addCustomView |
Clear | setValue(null) |
SubmitCrmForm | Xrm.Page.data.entity.save |
GetLabelControl | controlObj.getLabel() |
Actually this table listed a small portion of the issues, but even these issues might require time consuming efforts and help with upgrading MS CRM for multi-browser support.
document.getElementById('new_field').onclick = FormerClientChange;
instead you can use functions:
Xrm.Page.getAttribute("new_field").addOnChange(myFunction);
if (document.getElementById('nav_myitem') != null) {
if (document.getElementById('nav_myitem').children.length > 1) {
if (document.getElementById('nav_myitem').children[1].tagName == "NOBR") {
document.getElementById('nav_myitem').children[1].setAttribute('title', "Some text");
document.getElementById('nav_myitem').children[1].innerText = "Some text";
}
}
}
instead you can use functions:
Xrm.Page.ui.navigation.items.get("nav_myitem").setLabel("Other Addresses");
document.getElementById('new_field').style.visibility = 'hidden';
instead you can use functions:
Xrm.Page.getControl("new_field").setVisible(false);
document.getElementById('nav_myitem').style.display = 'none';
instead you can use functions:
Xrm.Page.ui.navigation.items.get("nav_myitem").setVisible(false);
objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
instead you can use functions from jQuery $.ajax or the following function:
function GetXmlHttpObject() {
var objXMLHttp = null;
if (window.XMLHttpRequest) {
objXMLHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
How we process your personal data