Experience in resolving Breaking Script Issues When Upgrading Microsoft Dynamics CRM customization for multiple-browser support

 

WaveAccess experience in resolving Breaking Script Issues When Upgrading Microsoft Dynamics CRM customization for multiple-browser support

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 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.



insertCell
$("<tr>").appendTo
document.all
$(element)
attachevent
$(element).bind
innerText
$(element).text
FormType
Xrm.Page.ui.getFormType()
crmForm
Xrm.Page
AddParam
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.

You might have a question “what are the most typical problems you might face?”.

To help you answer, below we listed the 6 mostly frequently met situations and issues that our customers had:
1. Assign event directly:
document.getElementById('new_field').onclick = FormerClientChange;
instead you can use functions:
Xrm.Page.getAttribute("new_field").addOnChange(myFunction);
2. Rename element in navigation
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");
3. Hide the field
document.getElementById('new_field').style.visibility = 'hidden';
instead you can use functions:
Xrm.Page.getControl("new_field").setVisible(false);
4. Hide navigation element
document.getElementById('nav_myitem').style.display = 'none';
instead you can use functions:
Xrm.Page.ui.navigation.items.get("nav_myitem").setVisible(false);
5. To use XMLHttpRequest do not use ActiveX objects directly:
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;
}

If you do not have time for dealing with such issues we can help you
• Identify whether any unsupported methods have been used in your solution
• Resolve all identified issues
• Conduct testing
Please contact us info@wave-access.com or +1 866 311-24-67 to find out more.