Greetings,
I am experiencing a road block according to the import error log while trying to converting the legacy code within one of the Web Resources of Dynamics CRM to be multiple browser friendly. There is an ‘ActiveX’ component that is explicit to IE and is incompatible with alternate browsers. Ultimately I am attempting to make the underlying code cross browser compatible.
I have utilized a JavaScript converter up to this point which has been extremely beneficial in expediting the code conversions for many of the Web Resources, however it does not accurately convert the web resource in question.
When attempting the import of my organization Organization into Dynamics 2015,
<Severity>Error</Severity>
<Component>WebResource</Component>
<Message>Web resource tw_quoteinfo contains a reference to the 2007 web service endpoint</Message>
The use of ActiveX within CRM code is incompatible with browsers that are not Internet Explorer, and any code that uses it will have to be re-written before these libraries are functional within non-IE browsers
Googled this one extensively but not making much progress. Installed the Microsoft Custom Code Validation Tool for my CRM 2013 install. Ran it and it indicates an ActiveX incompatibility issue.
When doing a test migration to 2013 from 2015, I received the following error during System Checks: "The JavaScript web resources in your system contain a reference to the Microsoft Dynamics CRM 4.0 (2007) Web service endpoint. The 2007 endpoints are not supported in this release." I went to the log file specified and received:
<Severity>Error</Severity>
<Component>WebResource</Component>
<Message>Web resource tw_quoteinfo contains a reference to the 2007 web service endpoint</Message>
I was able to use a tool that auto-fixed items needing xrm, but this seems more extensive.
I have included my code as it exists below. What should the code be converted to for cross browser compatibility with Dynamics CRM 2015.
Thanks in advance,
Mick CRM
//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
function quoteinfo()
{
alert(1);
//if (Xrm.Page.getAttribute("tw_state1").getValue() != null)
//{
// - lookup has to be an array - will be the lookup that you are retrieving data from
var lookUp = new Array();
alert(1);
// - the actual lookup field - puts the values of the name, object type, and GUID in the array
lookUp =Xrm.Page.data.entity.attributes.get("tw_associatedquote").getValue;
alert(lookUp);
var pId = lookUp[0].id;
alert(pId);
//alert(lookUp[0].name);
var pType = lookUp[0].typename;
alert(pType);
// - Value in quotes is the name of the field from the entity that is referenced in the lookup field
alert(1.5);
var x = "tw_modifier";
alert(1.75);
alert(x);
if (pType == "systemuser")
{
//alert(2);
x = "tw_modifier";
}
var authenticationHeader = Xrm.Page.context.getAuthenticationHeader();
//alert(3);
// Define the SOAP XML to access Microsoft Dynamics CRM Web service. Place field with field name from above in body below.
var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap="+
"\"schemas.xmlsoap.org/.../envelope\" "+
"xmlns:xsi=\"www.w3.org/.../XMLSchema-instance\" "+
"xmlns:xsd=\"www.w3.org/.../XMLSchema\">" +
authenticationHeader+
"<soap:Body>" +
"<Retrieve xmlns="+
"\"schemas.microsoft.com/.../WebServices\">" +
"<entityName>" + pType + "</entityName>" +
"<id>" + pId + "</id>" +
"<columnSet xmlns:q1='schemas.microsoft.com/.../Query' xsi:type='q1:ColumnSet'><q1:Attributes><q1:Attribute>" + x+ "</q1:Attribute></q1:Attributes></columnSet>" +
"</Retrieve>"+
"</soap:Body>" +
"</soap:Envelope>";
//alert(3.15);
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
// Configure the XMLHttp object for the
// Microsoft CRM Web services.
//alert(3.25);
xmlHttpRequest.Open(
"POST",
"/mscrmservices/2007/CrmService.asmx",
false
);
xmlHttpRequest.setRequestHeader(
"SOAPAction",
"schemas.microsoft.com/.../Retrieve"
);
xmlHttpRequest.setRequestHeader(
"Content-Type", "text/xml; charset=utf-8"
);
xmlHttpRequest.setRequestHeader(
"Content-Length", xml.length
);
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var pNum = null;
//alert(3.5);
if (resultXml.selectNodes("//q1:" + x).length == 1)
{
//alert(4);
//Xrm.Page.getAttribute("tw_modifier").setValue(resultXml.selectSingleNode("//q1:" + x).text);
var num= resultXml.selectSingleNode("//q1:" + x).text;
var numfloat= parseFloat(num);
Xrm.Page.data.entity.attributes.get("tw_modifier").setValue(numfloat);
}
//End Bracket below
}
*This post is locked for comments
I have the same question (0)
Aric Levin - MVP
2
Moderator
MA-04060624-0
1