• Jimmmy
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies
I have an S-Control that is on a couple pages.  How can I find out which tab the user is on?  I am trying to stay away from hard coding anything. Thanks.
  • March 31, 2008
  • Like
  • 0
Is there a way to Dynamically Query Merge fields that would include all custom merge fields that were set up? this would be for use in an S-Control.
  • March 27, 2008
  • Like
  • 0

Is there a way to Dynamically Query Merge fields that would include all custom merge fields that were set up? this would be for use in an S-Control.

  • March 27, 2008
  • Like
  • 0
We are using the remoteFunction and we have set a timeout but it still defaults to the 10 second timeout? 
Here is the code we are using.
 
sforce.connection.remoteFunction({ url : url,
timeout : 60000,
method: "POST",
requestData: template,
async: false,
requestHeaders: { "Content-Type": "text/xml","SOAPAction": https://www.ourwebsite.com},
    onSuccess : function(response) { message = response;},
    onFailure : function(error) { alert(error); }});
 
we pass in XML and retrieve XML as a response.  It works great until we have a larger sized XML
being sent and then we run into issues.  The server is receiving the data and the remoteFunction
is not paying attention to the timeout call. So we get
 
<html>
<head><title>400 Unable to forward request due to: Read timed out</title></head>
<body>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />
<small>
Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
</small>
</body></html> 
 
Does anybody have any ideas or know of any work a rounds... Any help will be greatly appreacheated.
  • March 20, 2008
  • Like
  • 0
We are using the remoteFunction and we have set a timeout but it still defaults to the 10 second timeout? 
Here is the code we are using.
 
sforce.connection.remoteFunction({ url : url,
timeout : 60000,
method: "POST",
requestData: template,
async: false,
requestHeaders: { "Content-Type": "text/xml","SOAPAction": https://www.ourwebsite.com},
    onSuccess : function(response) { message = response;},
    onFailure : function(error) { alert(error); }});
 
we pass in XML and retrieve XML as a response.  It works great until we have a larger sized XML
being sent and then we run into issues.  The server is receiving the data and the remoteFunction
is not paying attention to the timeout call. So we get
 
<html>
<head><title>400 Unable to forward request due to: Read timed out</title></head>
<body>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />
<small>
Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
</small>
</body></html> 
 
Does anybody have any ideas or know of any work a rounds... Any help will be greatly appreacheated.
  • March 20, 2008
  • Like
  • 0
I'm getting the following error when I run the an s-contro:
 
uncaught exception: arg 1 'sObjectType' not specified
newConnection()connection.js (line 659)
send("<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urn:partner...", Object, false)connection.js (line 669)
_invoke("query", [Object name=queryString], false, undefined, [Object ns=urn:partner.soap.sforce.com, Object ns=sobject.partner.soap.sforce.com prefix=ns1], "/services/Soap/u/8.0", "urn:partner.soap.sforce.com", "sobject.partner.soap.sforce.com")connection.js (line 1573)
invoke("query", [Object name=queryString], false, undefined)connection.js (line 1516)
query("Select Candidate__c From Job_Application__c Where Position__c = 'a014000000B428U'", undefined)connection.js (line 1272)
doQuery()servlet.Integrati... (line 65)
 
Here is the s-control:
 
<html>
<head>
<style type="text/css">
#mapContainer {
height: 475px;;
width: 600px;
}
</style>

<script language="javascript" src="/soap/ajax/8.0/connection.js"
type="text/javascript"></script>
<script type="text/javascript"
src="http://api.maps.yahoo.com/ajaxymap?v=3.0&amp;appid=salesforce.com">
</script>

<script type="text/javascript">
var conn;
function initPage() {
conn = sforce.connection;
loadMap();
}

var reload = true;
var map;
var link;
var geoPoints = [];
var dataPointCount = 0;
var pointCounter = 0;

function geoCodeEnd(r) {
if (r.success == 1) {
if (r.GeoPoint.Lat != 0) {
geoPoints[geoPoints.length] = r.GeoPoint;
pointCounter++;
}
} else {
pointCounter++;
}
if (pointCounter >= dataPointCount) {
var bestZoomLevel = map.getZoomLevel(geoPoints);
if (bestZoomLevel < 5) bestZoomLevel = 5;
var geoCenter = map.getCenterGeoPoint(geoPoints);
map.drawZoomAndCenter(geoCenter, bestZoomLevel);
map.panToLatLon(geoCenter);
}
}

function loadMap() {
// Create a map object
map = new YMap(document.getElementById('mapContainer'));
// Display the map centered on given address
YEvent.Capture(map, EventsList.onEndGeoCode, geoCodeEnd);
map.addZoomLong();

doQuery();
}

function doQuery() {
if (reload == false) return;
var positionId = "{!Position__c.Id}";
var qr = conn.query("Select Candidate__c From Job_Application__c Where Position__c = '" + positionId + "'");
if (qr.size > 0) {
var ids = [];
var records = qr.getArray("records");
for (var i=0;i<records.length;i++) {
ids[i] = records[i].get("Candidate__c");
}
conn.retrieve("Id, Last_Name__c, First_Name__c, Street__c, City__c, State_Province__c, Current_Employer__c,Candidate__c, ids, plotMarkers");
} else {
// Display map of US if no Candidates found
var myPoint = new YGeoPoint(40,-95);
map.drawZoomAndCenter(myPoint, 14);
alert("There are no candidates for this position to map.");
}
reload = false;
}

function doNav(arg) {
window.parent.location = "/" + arg;
}

function plotMarkers(qr) {
var records = qr;
if (qr.getArray) {
records = qr.getArray("records");
}
var counter = 1;
if (records.length > 0) {
for (var x=0;x<records.length;x++) {
var db = records[x];
if (db.get("Street__c") != null && db.get("City__c") != null && db.get("State_Province__c") != null ) {
dataPointCount++;
var addr = db.get("Street__c") + ", " + db.get("City__c") + ", " + db.get("State_Province__c");
var marker = new YMarker(addr);
marker.addLabel(counter);
var name = db.get("First_Name__c") + " " + db.get("Last_Name__c") ;
counter++;
name = "<a href='" + conn.describeSObject("Candidate__c").urlDetail.replace("{ID}", db.get("Id")) + "' target='_top'>" + name + "</a>";
marker.personName = name;
YEvent.Capture(marker, EventsList.MouseClick,
function() {this.openSmartWindow
("<div>This is where " +
this.personName +
" lives!<BR>&nbsp;</div>") });
map.addOverlay(marker);
}
}
}

}


</script>


</head>

<body onload="initPage();">
<div id="mapContainer"></div>

</body>
</html>
I have an S-Control that is on a couple pages.  How can I find out which tab the user is on?  I am trying to stay away from hard coding anything. Thanks.
  • March 31, 2008
  • Like
  • 0
Is there a way to Dynamically Query Merge fields that would include all custom merge fields that were set up? this would be for use in an S-Control.
  • March 27, 2008
  • Like
  • 0

Is there a way to Dynamically Query Merge fields that would include all custom merge fields that were set up? this would be for use in an S-Control.

  • March 27, 2008
  • Like
  • 0
We are using the remoteFunction and we have set a timeout but it still defaults to the 10 second timeout? 
Here is the code we are using.
 
sforce.connection.remoteFunction({ url : url,
timeout : 60000,
method: "POST",
requestData: template,
async: false,
requestHeaders: { "Content-Type": "text/xml","SOAPAction": https://www.ourwebsite.com},
    onSuccess : function(response) { message = response;},
    onFailure : function(error) { alert(error); }});
 
we pass in XML and retrieve XML as a response.  It works great until we have a larger sized XML
being sent and then we run into issues.  The server is receiving the data and the remoteFunction
is not paying attention to the timeout call. So we get
 
<html>
<head><title>400 Unable to forward request due to: Read timed out</title></head>
<body>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />
<small>
Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
</small>
</body></html> 
 
Does anybody have any ideas or know of any work a rounds... Any help will be greatly appreacheated.
  • March 20, 2008
  • Like
  • 0