function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gopsgops 

How to login to anoter salesforce instance using Apex?

Hi All,

 

I want to login to another salesforce instance and fetch the cases to my instance.Do we need to generate WSDL for the target instance and consume the WSDL here in the source instance? Is thsi approach correct or is there any other better approach to get the cases using Apex.

werewolfwerewolf
If you can wait until Summer '09 is available, you will be able to use Salesforce To Salesforce to share cases across Salesforce.com orgs -- that will be vastly preferable than trying to do what you're trying to do.
gopsgops

Thanks for the quick reply.

I heard that Salesforce to Salesforce can be used only between production instance and not with sandbox.Is that true?

Also along with with case sharing, will we be able to get the share solutions object in Summer '09 release.

 

Thanks

Gops

werewolfwerewolf

I don't think you can S2S to a sandbox but I'm not sure.

 

It will not be available for Solutions in Summer '09.

 

In general, I'm pretty sure you can't make a connection to another Salesforce.com instance from Apex.  You can either just do a sandbox refresh (if you're trying to fill data into your own sandbox) or you could use something like the Data Loader to export the data and then reimport it into the other org.