You need to sign in to do that
Don't have an account?

S-control works on Firefox but errors on IE
Hi there, am at my wit's end on this one. Have a fairly basic S-control which takes info from an opportunity and creates a new custom object called a Sales Order. Once it's done that it redirects the user to the new Sales Order. Have developed and tested this in Firefox 1.5.0.6 and it works fine. However testing on IE 6 SP1 keeps throwing up an "Object required" error (that ol' chestnut...). I know you'll say just use FF, but unfortunately the client doesn't want to change all their browsers just because of this...
Was finding it virtually impossible to figure out what IE was doing until I got hold of the MS script debugger. Once I turned that on, I was able to see where the script was breaking. However I found that it was in the sforceclient.js, Line 2541... this is the snippet of code from sforceclient.js (full path https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js?browser=true)
Sforce.PicklistEntry.prototype = new Sforce.SoapObject;
Sforce.PicklistEntry.prototype.active = new Boolean();
Sforce.PicklistEntry.prototype.defaultValue = new Boolean();
Sforce.PicklistEntry.prototype.label = new String();
Sforce.PicklistEntry.prototype.validFor = new Array();
Sforce.PicklistEntry.prototype.value = new String();
Sforce.PicklistEntry.prototype.active = new Boolean();
Sforce.PicklistEntry.prototype.defaultValue = new Boolean();
Sforce.PicklistEntry.prototype.label = new String();
Sforce.PicklistEntry.prototype.validFor = new Array();
Sforce.PicklistEntry.prototype.value = new String();
/** @ignore */
Sforce.getResponseNode = function(response) {
if (sforceClient.appType != Sforce.Application.Type.InternetExplorer) {
var bNode = response.getElementsByTagName("Body")[0];
for (i=0;i<bNode.childNodes.length;i++) {
if (bNode.childNodes[i].nodeType == 1) {
return bNode.childNodes[i];
}
}
} else {
return response.getElementsByTagName("soapenv:Body")[0].childNodes[0]; <---- BREAKING HERE
}
}
Sforce.getResponseNode = function(response) {
if (sforceClient.appType != Sforce.Application.Type.InternetExplorer) {
var bNode = response.getElementsByTagName("Body")[0];
for (i=0;i<bNode.childNodes.length;i++) {
if (bNode.childNodes[i].nodeType == 1) {
return bNode.childNodes[i];
}
}
} else {
return response.getElementsByTagName("soapenv:Body")[0].childNodes[0]; <---- BREAKING HERE
}
}
I have absolutely no idea why this would be happening. Only thing I can think of, is that I have some HTML text in the S-control, which displays the "Processing" dots. I'm wondering if perhaps my HTML text is not laid out correctly. I can see that this code only executes for IE, but not sure whyit would cause processing to stop.
As an aside (not sure if it's related or not) I also get a "this page contains both secure and non-secure...." warning message when running on IE but I don't on Firefox.
Anyone seen this before? Or have any clues as to what might be going on? Or is there another version of the sforceclient (not beta 3.3) that I could also try?
Thanks very much for your help.
Stephen Brown
Sofia Works Ltd
75 Cannon St,
London EC4N 5BN, U.K.
Which may work (I have not tried the fix yet).
Message Edited by Gareth Davies on 08-22-2006 07:41 AM
Steve Bower.
I managed to get this working in IE by separating out the includes for the browser support. Before I had
<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js?browser=true" type="text/javascript"></script>
changed this to
<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/browsersupport.js" type="text/javascript"></script>
and this seemed to solve the problem.
Thanks again for the comments.
Stephen