Sub topic 2
What Salesforce Connect Provides
Prerequisites
This chapter assumes you know Salesforce objects, fields, and relationships. You should also be able to find your way around Setup and permission sets, and read a basic SOQL query. You don't need to write any Apex yet.
The working model
Salesforce Connect is a framework that maps tables in another system to external objects in your org. An external object looks like a custom object, but its API name ends in __x, and Salesforce does not store its rows. When a user opens a record or a list view, or when code runs a query, Salesforce makes a live callout to the external system and shows what comes back.
The framework has four parts:
| Part | Role |
|---|---|
| Adapter | Speaks the protocol of the external system, such as OData or a cross-org connection |
| External data source | Setup record that holds the adapter type, the endpoint, and the authentication choice |
| Named credential | Stores the endpoint and login details so they stay out of the data source settings |
| External object | The Salesforce-side definition of one external table, with its fields |
Each external object has two standard fields. ExternalId identifies a row in the external system. DisplayUrl holds a link used when Salesforce shows the record. Custom fields on external objects still end in __c.
What you can do with it
Once an external object exists, you can treat it much like a custom object:
- Add it to tabs, page layouts, and list views.
- Query it with SOQL and Apex.
- Link it to other records with external lookup and indirect lookup relationships.
- Write to it, if the external system and data source allow writes.
This query reads from a hypothetical Product__x object. Salesforce Connect turns it into a request to the external system.
SELECT ExternalId, DisplayUrl, Name__c, Price__c
FROM Product__x
WHERE Price__c > 100
ORDER BY Name__c
LIMIT 20Later chapters cover each of these in detail.
What changes when data stays remote
Because nothing is copied, you get current data and don't use Salesforce data storage for those rows. In exchange, every read depends on the external system being up and fast. Salesforce also treats these callouts as limited resources, so a design that works for ten users can fail for a thousand.
Common mistakes at this stage:
- Looking for
Product__cwhen the object isProduct__x. - Assuming the external data appears in Salesforce reports and automation exactly as local data does. Some features are limited for external objects, so check before you design around them.
- Running a query with no
WHEREclause orLIMIT. This sends a large request to the external system and may hit a limit. - Skipping the licensing check. Salesforce Connect is commonly sold as an add-on, so confirm that your org has it.
Exercise
A teammate says the product catalog is now in Salesforce because an external object Product__x exists. Is that correct? Name one benefit and one risk of this setup.
Show answer
No. The rows stay in the external system, and Salesforce only reads them (and writes to them, if allowed) through live callouts. One benefit is that users always see current data, and the rows don't use Salesforce data storage. One risk is that page loads and queries depend on the external system's availability and speed, and they count against callout limits.