+ Start a Discussion

Help with RemoteFunction

I am trying to use a remoteFunction to get the names and ids of reports currently available to the logged in account.  Here's the function I'm using
async : false,
//mimeType: 'text/xml',
cache : true,
url : '{!API.Partner_Server_URL_60}'.substring(0,26) + '/servlet/servlet.ReportList?sessionid={!API.Session_ID}',
onSuccess : reportsReady,
onFailure : errorReport

function reportsReady(response) {

function errorReport(error) {
alert('error:' + error);

When I load the generated url in a browser, I get an xml listing of my account's reports.  When run through AJAX,  it generates the errorReport with the following response:
<xml version="1.0">
Does anyone see anything wrong with the way I'm going this?

Message Edited by pfarrell on 09-12-2007 07:08 AM

As an amendment, I've found a hint about why this is failing...

Using Firebug, I can see that I'm getting an error when AJAX tries to load the following location:


If I try to load that location in a browser, I get the following error:

SalesforceProxy-Endpoint not defined in header

This is presumably because the remoteFunction call adds something to the header.
remoteFunction is only need if you are calling an external server. If you are calling
back to salesforce.com you can make the call directly.

That makes sense.  Thanks Cheenath.