Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Mar 5, 2013

If a user sets up a custom domain using Setup > Company Profile > My Domain, there URL will be "https://abc.my.salesforce.com". Without this patch, the proxy calls will fail due to an invalid instanceUrl value of "https://my.salesforce.com".

@ghost
Copy link
Author

ghost commented Mar 5, 2013

Steps to reproduce:

  1. From the Setup menu, go to Company Profile, then My Domain
  2. Enter a value into the domain box and click the I Agree box and click the Register button
  3. After the domain is setup, create a Visualforce page with the following script
<apex:includeScript value="{!URLFOR($Resource.static, 'static/jquery-1.5.2.min.js')}"  />
<apex:includeScript value="{!URLFOR($Resource.sample, 'forcetk.js')}"  />
<script type="text/javascript">
var successCallback = function() {
    console.log('success');
};
var failCallback = function() {
    console.log('failed :-(');
};

var client = new forcetk.Client();
client.setSessionToken('{!$Api.Session_ID}', 'v27.0');
client.query('SELECT Id, Name FROM Account ORDER BY Name LIMIT 20', successCallback, failCallback);
</script>
  1. Open the Javascript console to see the network request (Network panel in Chrome)
  2. Open the VF page with the above

Notice the request will fail due to the SalesforceProxy-Endpoint being set to "https://my.salesforce.com/services/data/v27.0/query?q=..."

metadaddy pushed a commit that referenced this pull request Mar 5, 2013
Add support for custom domains from My Domains
@metadaddy metadaddy merged commit 74b2cdd into developerforce:master Mar 5, 2013
@metadaddy
Copy link
Contributor

Looks great - many thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant