There are several ways to connect two Salesforce orgs. The method you choose depends on the business’s needs and technical expertise available. These are: event-based integration using Change Data Capture or Platform Events, an API Integration, and middleware tools like Mulesoft, Jitterbit, or Boomi or Salesforce Connect with the cross-org adapter. I don’t call out Salesforce to Salesforce as a method as this is phasing out.
Having previously used Salesforce to Salesforce and spent many hours catching and fixing synchronisation issues, I wanted to dive into the Salesforce Connect – Cross Org Adapter. What’s the difference between the two? Salesforce to Salesforce is essentially data replication. It creates a “like” record in the receiving Salesforce org. Salesforce Connect – Cross Org Adapter is data virtualisation. The data appears in an external object.
Salesforce Connect lets users view, search, and modify data that’s stored outside that Salesforce org in external data sources where an OData connection can be made. Instead of copying the data into standard or custom objects, it uses external objects to access the data in real-time via web service callouts. With the cross-org adapter, Salesforce Connect uses Lightning Platform REST API calls to access records in other Salesforce orgs via external objects. This is data virtualization rather than replication.
How to set it up:
1. I signed up for two developer edition Salesforce Orgs.
2. I set up a Connected App in the Salesforce Org from which I wanted to see the data from (see this Connected App article on how to set up a Connected App)
3. Then in the Salesforce Org I wanted to see the data in, I created an Auth Provider and an External Data Source:
4. The Consumer Secret and Key were copied from the Connected App I created into the Auth Provider settings.
5. I used Named Principal and OAuth 2.0 to set up the External Data Services and then clicked Validate and Sync.
6. I selected the Account Object to Sync and chose to name it External Account in the user interface.
7. After creating a Tab so that the External Accounts Object was easy to find. I had a look at the data that was synced.
8. Each Account had a URL that I could click on, and if not already authenticated in the second org, I could enter a username and password to view it. All lookups show only the Salesforce ID and not a “lookup” to the related record. In addition to this, Person Accounts were brought across the “merged” Account and Contact as one Account record.
Some items to note:
- If the Schema changes in the originating Salesforce Org, the External Object will need to be validated and synced again to pick up any changes.
- Global Picklists are not synchronised
- An API call is made every time a user clicks on the External Object’s Tab (if one was created) or looks at a list view, report, or record that has an external object referenced, if it is called in global search, if it is added to a flow, etc and every edit, create, delete on the external object.