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
NareshNaresh 

Login in to Different SFDC org using Apex

Hi ,
is there any way to login from one Salesforce.com org into another Salesforce.com org using Apex. Actually, i have written one Apex class and wanted to login into a different SFDC org from that class.

Please post me if anyone have any solution.

Thanks in advance,
NG
digamber.prasaddigamber.prasad

Hi Naresh,

 

Did you get solution of this problem. I am facing the same problem and couldn't get any resolution.

 

Regards,

Digamber Prasad

jason.wanjason.wan

Also curious on whether there is any sample code for this one.  Saw some code with Apex Webservices API, but is there anything more direct with just using Apex Code in a Class and possibly Visualforce to get username and password and a picklist - choice of production or sandbox. 

WizradWizrad

You can accomplish this by taking the partner wsdl, and using wsdl2apex to generate apex code that can log into other orgs.

 

What is the use case for this?

 

You're either doing something badass, or you're doing something wrong.