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
anuj huriaanuj huria 

create Account from one org to another

please tell me how can i achive this

=> if i create an account in my org,same account should be create in another org

suggest me some ideas and code if possible

Ravi Dutt SharmaRavi Dutt Sharma
Hey Anuj,

You can use Salesforce to Salesforce to achieve this. Salesforce to Salesforce can be used to create this data sharing relationship. Salesforce to Salesforce is a natively supported feature of the Force.com platform, and easily enables two trading partners to share relevant data records between orgs.
More information here : Introduction to Salesforce to Salesforce (https://developer.salesforce.com/page/An_Introduction_to_Salesforce_to_Salesforce)
anuj huriaanuj huria

Thanks Ravi,

let me check

anuj huriaanuj huria
Hi Ravi,
I want ot achive this using REST API and Integration 
nagendra 6989nagendra 6989
Hi anuj huria,

If you can send me your email address i will share the document with you so that easily you can achieve your challenge using integration.

Thanks & Regards
Nagendra.P
9848950830



 
anuj huriaanuj huria

Hi nagendra babu 21

huria.99.anuj@gmail.com

sandhya reddy 10sandhya reddy 10
Hi Anuj,

You can achieve this through SOAP Integration. Please Follow the below steps.
 
Salesforce Integration
Integration between two different organisations of salesforce:
            To perform integration between two different organisations of salesforce,we consider following scenario
            Consider org1 and org2 are different organizations in salesforce.These two organisations contain a Sobject “Book” .If we insert a new record in anyone these organisation then similar has to be inserted in other organization also(i.e Bidirectional Integration).To perform integration between these organizations we need following aspects
  1. webservice Class wsdls of two organizations.
  2. Partner wsdls of two organizations.
  3. Credentials of both organizations including security token.
Step1:
Write webservices in both organizations
In webservice class ,
  • abstraction for class is “Global” and
  • abstraction for method is “webservice static
Org1 web service class
User-added image
User-added image
 
  1.  
 
Generate wsdl for corresponding web service class in both organizations.
  •  
Go to webservice apex class click on classname,clickon generate wisdol
Save wsdl files with either .xml or .wsdl extension.
Step3:
            Generate Partner wsdls for both organizations.
            Search API in quick find box—in API click Generate Partner wisdol
            Share webservice and partner wsdls with other organization.(go to apex classes and click generate from wisdol,select wisdol file and create apex class,again select partnerwisdol xml file)
Step 4:
            Generate classes in org1 from org2 wsdl and vice versa.
            Webservice wsdl will generate only one apex class.
            Partner wsdl generates 3 apex classes.
Step 5:
            If a record is inserted in one organization then similar record has to be inserted in other organization also. This behavior can be achieved through Trigger, So we write trigger in each organization .
            An Apex trigger can execute a callout when the callout is invoked within a method defined as asynchronous: that is, defined with the @future keyword. The @future annotation signifies that the Apex method executes asynchronously.
Org1
For this we define a class

User-added image
Provide username and password with security token as parameters in Login().
Now we define trigger
User-added image

Org2
For this we define a class
User-added image
Provide username and password with security token as parameters in Login().
Now we define trigger


                                                                                       -- to be continued
sandhya reddy 10sandhya reddy 10
Now we define trigger

User-added image

Step 7:
            Now if we insert a record in one organization then similar record is created in other organization also.
 
            This is an example to explain procedure to perform integration between two organizations of salesforce.

Hope this helps you.

If This answer worked for u please mark it as Best Answer.


Thanks,
Sandhya Reddy.



 
anuj huriaanuj huria
Hi sandhya reddy 10
I appreciate your response,but i want to achive this using REST API
Thanks 
sandhya reddy 10sandhya reddy 10
hi Anuj,

I got some links for REST Approach which may be useful for you

http://www.jitendrazaa.com/blog/salesforce/getting-record-from-one-salesforce-organization-to-other/

http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-using-named-credentials-in-just-5-lines-of-code/