Salesforce Connect
Salesforce Connect is a framework that enables you to view, search, and modify data that’s stored outside your Salesforce org.
For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts.
Salesforce Connect lets your Salesforce org access data from a wide variety of external systems.
Overview of Setup
1.Create the external data source.
2.Create the external objects and their fields.
3.Define relationships for the external objects.
4.Enable user access to external objects and their fields.
5.Set up user authentication.
- Enable users to authenticate to the external data source.
- Set up each user’s authentication settings.
Follow these steps to install the package.
- Open a browser, and click here to start the installation. (you need to login into your salesforce org to complete this)
- Select Install for Admins Only.
- Click Install
- Select the External Orders app
- Click Set Customer IDs to assign customer ID numbers to the sample account records in your Developer Edition.
Connect an External Data Source
As an exercise, let’s connect an existing OData 2.0 data source that’s publicly accessible.
- From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.
- Click New External Data Source.
- Enter OrderDB as the label. As you click or tab away from the label field, the name field defaults to OrderDB.
- Select Salesforce Connect: OData 2.0 as the type.
- Enter https://orderdb.herokuapp.com/orders.svc/ as the URL.
- Leave the remaining settings with their default values and click Save.
Note
Because this is a sample, read-only database, no authentication is required. A real external system would likely require some credentials.
Create External Objects
You can create or modify an external object.
- From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources and then click the OrderDB external data source.
- Click Validate and Sync.
- Select both Orders and OrderDetails.
- Click Sync.
Syncing creates the external objects corresponding to the tables that you selected. Syncing does not store any data in Salesforce. Syncing only defines mappings to external tables or repositories that contain the data. These mappings enable Salesforce to access and search the external data.
View External Data
After you’ve connected the external data source and defined the external objects, you can view the external data directly in your Salesforce org.
- From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.
- Click the OrderDB external data source.
- Scroll down to External Objects and click Orders.
Salesforce Connect’s sync process created this external object from the external system’s schema. If you’re familiar with custom objects, you notice that external objects look similar.
The sync process also created a set of custom fields just as you create them for a custom object. The key differences between external object and custom object definitions are:
- External object API names have the suffix __x rather than __c.
- External objects have a reference to their external data source and a table within that source.
- External objects have different standard fields. Display URL is the OData 2.0 URL representing a record in the external database, while External ID is the primary key value for each record.
Let’s create a custom tab to easily access the order records.
- From Setup, enter Tabs in the Quick Find box, then select Tabs.
- Click the New button next to Custom Object Tabs.
- Select Orders as the Object.
- Click the selector next to Tab Style and choose whichever style you like.
- Click Next.
- Click Next to accept the default tab visibility settings.
- Click the checkbox next to Include Tab to deselect all the apps.
- Click the checkbox next to External Orders to select it.
- Click Save.
Note:
Because there’s also a standard object named Order, you now have two tabs with the label of Orders. You can change the tab name for your external object by changing the label in the object definition.
You can now view the external order data as if it was stored in custom objects in your Salesforce org.
- If the app menu (top right) is not already showing External Orders, click the app menu and select it.
- Click the Orders tab.
- Click the Go! button next to View: All.
- Click one of the order External ID values.
Salesforce Connect retrieved all the field values for the order you selected.
It’s important to remember that external data is never duplicated in your Salesforce org. Salesforce Connect always fetches current data from the external system in real time.
Now that you can see external data in your org, you can also link it to existing data by creating lookup relationships. You’ll see how to do that in a later unit.
Set Up User Authentication
The sample database used in this unit did not require authentication. However, a real external system is likely to require login credentials. You have two options for setting up user authentication for an external data source.
- Named Principal—Your entire Salesforce org shares one login account on the external system.
- Per User—Your org uses multiple login accounts on the external system. You or your users can set up their personal authentication settings for the external system.
This blog is discussed the detailed information about Salesforce Connect.