Salesforce Connect – Everything You Need To Know
When you want to view the data existing in your ERP system in Salesforce, you’ve to integrate Salesforce with an external system and create a copy in Salesforce. When you have a copy in your Salesforce, you can view the data at any time. When data is stored in Salesforce. It occupies Salesforce memory. You can access external systems data in Salesforce without actually storing it.
This can be achieved through the concept of ‘Salesforce Connect’. It allows you to view the data, modify the data and search for the data existing on the external system in real-time without copying it to Salesforce. Salesforce Connect supports different types of the external system like Microsoft SQL Server, Dynamics CRM/NAV, Azure Table Services, Heroku Connect External Objects etc. Salesforce provides ‘External Data source’ and ‘External Objects’, which helps to access external data in real-time.
In this example, we’re going to see how to connect with ‘Heroku External Data Source’. In order to connect to an external data source an ‘External Data Source’ needs to be created in Salesforce.
External Data source:
An ‘External Data Source’ needs to be created to connect with ‘Heroku External Data Source’. Below are the steps to create an ‘External Data Source’.
- Navigate to setup -> Build -> Develop -> Lightning Components -> External Data Source
- Click on New ‘External Data Source’ button and provide the details.
- Here I’m giving Name as ‘Test’ and the type of ‘Salesforce Connect’ as ‘Salesforce Connect: OData 2.0’
- I’m connecting to ‘Herokuapp’ to get the orders. So, I’m providing the URL as ‘http://orderdb.herokuapp.com/orders.svc/’ and leave the remaining fields with default values.
- In the above figure, there’s a checkbox called ‘Writable External Objects’. When that checkbox is checked, we can write the data to the external system.
- Now, click on the ‘Save’ button. You’ll be navigated to the following screen
- Now, click on the ‘Validate and Sync’ button shown in the above screen. You’ll be navigated to the following screen
- Here, the list of objects which can be synced from the external system will be shown. Select the objects you want to sync and click on ‘Sync’ button. I’ve selected ‘Order’ and ‘Order Details’.
- Here, I’m using existing external objects. You can create custom external objects according to your business requirement.
- On clicking the ‘Sync’ button, the selected external objects will be created automatically. You’ll be navigated to the below screen where the list of selected external objects will be shown
Configuring External Objects:
External objects are similar to custom objects. Each external object will be mapped to a table in the external system. Here, I’m creating an ‘Indirect Lookup relationship’ in ‘Order’ object. Indirect lookup relation is similar to lookup relation. It links the external object with Standard or custom object. Here, I’ve a custom field named ‘Customer ID c’ on ‘Account’ object which is ‘External ID’ and ‘Unique Case Insensitive’. This field stores the external system’s customer id in Salesforce. Now, we’ve to create an indirect lookup relation between External Order and Account objects.
Steps to configure External Object:
- Select the ‘Order’ object from the list of external objects
- Click on ‘Order’ object. You’ll find the below screen, where you can see the list of fields existing in ‘Order’ object
- Now, click on the edit link of ‘customer ID c’ field to change the field type. On clicking edit, the below screen will be shown
- Click on ‘Change field Type’ to change the field type. Below screen will be shown.
- Now, select ‘Indirect lookup relationship’ as shown below and click on ‘Next’ button.
- In the below screen, select the ‘Related to’ field as ‘Account’ (As an indirect lookup is related to ‘Account’) and click on the ‘Next’ button.
- In the below screen, select the target field as ‘Customer ID c’ and click on ‘Next’ button
- In the below screen, provide the length as 18 and click on ‘Save’ button.
- Now, create a Tab for ‘Order’ Object and go to ‘Orders’ Tab. You can view the list of orders as shown below
- When you click on ‘External ID’ link, you’ll get the order details as shown below
In this way, we can access the data from an external system in real-time without storing the data in Salesforce and without writing any code.
Below are the limitations which need to be followed while using Salesforce Connect
- The maximum of 100 external objects can be created per an organization.
- The maximum number of joins per query across external objects and other types of objects is 4.
- The maximum length of the OAuth token that’s issued by the external system should be less than 4,000 characters.
- The maximum page size for server-driven paging is 2,000 rows.
Now, you can easily connect your Salesforce CRM with other line of business applications to automate the business process!