We have a reseller of our product based out of South Africa. While I have worked on an existing SF2SF connection I have yet to set up one from scratch. Here we go...
So right off the bat I found this site on the
developer forums. Perfect for this initial setup. I'm familiar with the Connections tab, available after you Enable Salesforce to Salesforce from the setup menu, but I didn't know the Connection would be with a Contact that exists in your org. Make sure they have the right permissions to do this in their org.
Instead of grabbing screenshots from my org I'll just be pasting from the link above...
Enabling Salesforce to Salesforce
Before you can use Salesforce to Salesforce (S2S), you have to enable it. This has to be done by both parties - on your org, as well as on the org with which you are going to share data. Administrators can enable Salesforce to Salesforce by accessing it in the setup menu. Note that once the preference is enabled, it cannot be disabled.
To enable, navigate to Setup -> App setup -> Customize -> Salesforce to Salesforce -> Settings. Hit Edit, select Enable, and then select Save.
Once Salesforce to Salesforce is enabled in your org, you can establish data sharing relationship with another org by sending an invitation (we will cover sending invitations in a later section). You can customize the invitation by modifying the from email address, display name and email templates used for sending the invitation emails.
As a final step in this initial setup, you need to ensure that the user(s) managing the S2S connections have the appropriate permission to do so. In particular, enable the “Manage Connections” permission on the profile of the users. System administrator can create a new profile, for example "S2S Admin", and assign it to users who will be managing the connection. In smaller organizations the system administrator himself will probably be the person managing connections, in which case you may not need to create a separate profile.
You'll need to accept the connection via the email the contact will receive...
Setting up a Connection
Let's assume that your company, as well as another company, have enabled Salesforce to Salesforce. Even though both orgs have S2S enabled, you have to establish a formal relationship between the orgs before sharing can take place. This is done by setting up a connection.
For the sake of a running example let's use two companies
- Acme Corp - this wil be the connection initiating company.
- Appirio - this will be the connection receiving company.
As a best practice, in Acme Corp, create an account representing the company that will receive the connection (Appirio), and also create a contact with email address under that account. This contact will typically be used when sending the S2S connection invitation.
To begin using Salesforce to Salesforce, you need to use the Connections tab. If you don't have it in an application, add it by navigating to Setup -> My Personal Information-> Change my Display -> Customize My Tabs.
In new version we need to follow; Click on your name on right top corner -> My Settings -> Go to Display & Layout -> Customize My Tabs
On the Connections tab, click New to create a new connection with another org.
Select a contact under an account representing the other organization you want to share records with via S2S, and click "Save & Send Invite". The invitation email will be sent to the email address under the selected contact.
A connection owner also needs to be defined. The connection owner will receive all email notifications including system notifications in case there is a functional error when the connection is inserting/updating a record. Additionally, the connection owner will be assigned as the default owner of any new records, though this may be overridden by any assignment or other rules that determine record ownership.
When you click "Save & Send Invite" in this example, the Appirio system administrator (Joe Partner) will receive an email. Joe Partner will need to paste the URL in the browser address bar and login to initiate Salesforce to Salesforce connection. Here's an example invite:
Once logged in the Appirio org, the system administrator needs to hit Accept for the connection to start sharing records with Acme Corp.
Once the invitation is accepted, the connection to Acme Corp is established, no objects (standard or custom) are shared yet. Only data you choose to share will be shared - and that's that subject of the next section.
I'm Publishing Account information with our re-seller. They're publishing Opportunity info. Of course we're Subscribing to the respective Publications...
Publishing Objects
Once the connection is established, the next step is to publish and subscribe to objects. Both Acme and Appirio can publish and subscribe to each other's objects and fields.
To continue the tutorial, let's publish objects from Appirio. Do this by clicking on Publish in the Connection tab, and selecting the object that you wish to publish. You can publish most standard objects and all custom objects. We've selected Account, Attachment, Case, Case Comment, Contact and Lead.
Select Edit on an object to choose the fields that you wish to publish to the other environment.
As the following diagram indicates, we've chosen only to publish a handful of the fields related to an Account.
Modify each object to select the fields that you want to publish. This completes the publishing setup on the Appirio org. Let's now turn to the other environment and subscribe to these objects.
Subscribing to Published Objects
The receiving environment (Acme Org in our case) doesn't automatically have access to the data published from the Appirio environment. Rather, the org must first subscribe to the objects.
Login to Acme Corp and subscribe to these two objects and map the fields. This is done by navigating to the Connections tab, selecting the Appirio connection, and hitting "Subscribe". You'll now be presented with a list of the published objects to which you can subscribe:
The table essentially declares the mapping between the objects from the incoming org, and the objects to which they'll map in the receiving org.
An additional flag is sometimes displayed - Auto-Accept. If this option is selected, then records from the publishing org will be automatically accepted - the process will be entirely automatic. If you don't select the checkbox, then an administrator will first have to review incoming records before they are accepted. The checkbox is not always displayed. In particular, child objects are automatically accepted if parent objects are accepted, and the option is not available for junction objects either.
Now click Save. This completes the object level mapping. That is, we've defined which object from the Appirio environment maps to which object in the Acme environment.
Now you need to map the fields. Do this by clicking on Edit next to each object. Here we do so for the Account object.
Now map the published Account fields from the incoming environment to the the Account fields in your environment:
As the above diagram shows, we've mapped each field to the same field in the object in the receiving environment.
Field Mappings considerations
You may have come across situations where certain fields are not available for publishing, or where you are not able to subscribe to map some fields onto other fields. Here's a little more about this field mapping and how to resolve these.
- Data Type matching - Only matching data type fields can be mapped. In other words, the mapping enforces field type, dimension and precision. So for example, you can map a text field to any other text field of equal or greater size. Lookup or reference fields can be mapped to text fields (of size 80 or greater), and auto-number fields can also be mapped to text fields (of size 30 or greater).
- Field visibility - Lookup IDs are not available for publishing. You can enable S2S for those fields by creating a formula field and then publishing the formula field. In advanced section of formula field, select treat blank as blank.
The Salesforce to Salesforce setup is complete for Account and Contact objects sent from Appirio to Acme Corp. A similar setup can ensure that Account and Contact objects be shared from Acme Corp to Appirio.
Now for the details of sharing these records...
Using the Shared Connection
Now that you've got both environments set up on Salesforce to Salesforce, let's look at how the configuration can be used.
A one-way share between two environments is achieved by having the source environment publish, and the target environment subscribe. Here the source environment acts as a master environment and would overwrite shared records in the target environment whenever there is a change to the record in the source environment. Any changes made to the shared record in the target environment are lost when the source environment record changes in this scenario.
and this is critical to our situation...
A two-way share between environments is achieved by having both environments publish and subscribe to each others objects. Now shared records between the two environment synchronize whenever there is a change on either side.
In both cases, the Salesforce to Salesforce mapping determines which fields would flow from one org to the other.
Records can be shared in two ways , either manually or programatically.
How to Share...
Manual Sharing Records
Account, Contacts and most standard and all custom objects can be shared externally using S2S, Go to List view for the object and Select the records and click on "Forward to connection".
Select the connection and related objects if there are any, and save.
Note that only users with the Manage Connections profile permission will see the "Forward to connection" option. Additionally, users can only forward records they own or those owned by their subordinates (role hierarchy). System admins can share any record.
When records are forwarded, records will be automatically created in the target environment if auto-accept for the object is enabled. If it's not enabled, the records sent will need to be explicitly accepted in the target environment as shown in screenshots below. In particular, in the target environment select the object (Account in this example) tab, click on the Go button in "Accounts from connections":
Then click on "Accept" to accept the record in the target org.