Sub topic 2
What Salesforce Connect provides
Salesforce Connect lets an org read, and in some cases write, data that stays in another system. The data is not copied into Salesforce. This chapter describes the pieces Salesforce Connect gives you, how they fit together at runtime, and what it does and doesn't do for you. Later chapters configure each piece in detail.
This chapter assumes you know the basic Salesforce data model (objects, fields, relationships), can navigate Setup, and can read a simple SOQL query. Basic REST or OData knowledge helps but isn't required yet.
The core idea: a live window onto another system
Salesforce Connect is a framework of adapters that let your org query an external system in real time. The previous chapter contrasted two approaches:
- Copying moves records into Salesforce through an integration or ETL job. Salesforce owns a snapshot that can go stale.
- Virtualizing leaves the records where they are. Salesforce fetches them when a user or a piece of code asks for them.
Salesforce Connect implements the second approach. When a user opens a list view of external records, Salesforce sends a request to the external system, receives the rows, and shows them. When the user closes the page, nothing is left behind in Salesforce storage except the definition of the external object and any records that point to it.
The result is that external data looks like a Salesforce object to users and developers, but every read is a live callout.
The building blocks
Salesforce Connect is not one feature. It is a small set of components that you configure in a fixed order.
| Component | What it is | Where you meet it |
|---|---|---|
| Adapter | Code that knows how to talk to one kind of external system (OData 2.0, OData 4.0, cross-org, or a custom Apex adapter) | You choose one when you create the data source |
| Authentication setup | A named credential, usually paired with an external credential, that stores the endpoint URL and how to log in | Setup, under Named Credentials |
| External data source | The Salesforce record that ties an adapter to a named credential and holds connection settings | Setup, under External Data Sources |
| External object | A Salesforce object that represents one table, collection, or entity in the external system | Object Manager, with an API name ending in `__x` |
| Permission set | Grants access to the external object and its fields | Setup, under Permission Sets |
The dependency runs in one direction. The adapter and credentials feed the data source. The data source produces external objects. Permissions and UI configuration then expose those objects to users.
What an external object looks like
An external object is similar to a custom object, with a few differences that you can see right away.
- Its API name ends in
__x, for exampleProduct__x. Custom objects end in__c. - Its custom fields still end in
__c. - It always has a standard field named
ExternalId, which holds the unique identifier of the row in the external system. - It always has a standard field named
DisplayUrl, which holds a URL for viewing the record. - It has a Salesforce record Id, but that Id is generated for the row at the moment it is retrieved. The
ExternalIdis the stable key.
You query it with the same SOQL syntax you already know:
SELECT ExternalId, DisplayUrl, Name__c, Price__c
FROM Product__x
WHERE Price__c > 100
ORDER BY Name__c
LIMIT 20Salesforce does not run this against a local table. The adapter translates it into a request the external system understands, such as an OData query with $filter, $orderby, and $top. The external system does the filtering and sorting, and Salesforce receives only the matching rows.
How a request flows
The diagram shows what happens when a user opens a list view of external records.
Three points follow from this flow:
- Latency is part of the user experience. The page cannot render until the external system answers.
- Availability is shared. If the external system is down or slow, the Salesforce page that depends on it is affected.
- Query design matters. A filter that the adapter can pass to the external system returns less data than a filter that must be applied after retrieval.
What Salesforce Connect gives you
Access without storage
External records do not count against your org's data storage, because Salesforce does not keep them. You still use some metadata storage for the object definitions, but that is small. This is often the first reason teams consider Salesforce Connect, especially for large, rarely viewed datasets such as historical orders or product catalogs maintained in an ERP.
Current data
Each read goes to the source, so users see the data as it is now. There is no sync schedule to tune and no reconciliation job to debug.
Familiar tools
Because external objects are Salesforce objects, many existing tools work with them:
- SOQL and inline queries in Apex, covered in a later chapter.
- Tabs, page layouts, related lists, and list views.
- Permission sets for object and field access.
- Relationships to other objects through external lookup and indirect lookup fields.
- Writes through the UI or Apex, if the data source is set to allow them and the external system supports them.
Several ways to connect
You pick the adapter that matches the external system:
- OData 2.0 and OData 4.0 adapters connect to any service that exposes an OData endpoint. The service defines the schema, and Salesforce reads it.
- Cross-org adapter connects one Salesforce org to another and treats the second org's objects as external objects.
- Custom adapter is Apex code that you write with the Apex Connector Framework when no built-in adapter fits.
The next chapter compares them in detail.
What it does not do
Intermediate learners most often get into trouble by assuming an external object behaves exactly like a custom object. It does not. The differences come from the fact that Salesforce is not the system of record.
- No local copy. You cannot assume the data will be there if the external system is unreachable.
- Not every feature works. Some features that depend on local data, such as certain automation and sharing options, are limited or unavailable for external objects. Check the current Salesforce documentation for the full list before you design around a feature.
- Capability depends on the source. Sorting, filtering, writing, and search only work to the extent that the adapter and the external system support them.
- Record Ids are not permanent. Do not store a Salesforce Id for an external record in an integration and expect it to remain valid. Use
ExternalId. - Extra licensing may apply. Most adapters require a Salesforce Connect license, and the details vary by adapter and edition. Confirm with your Salesforce account team or the current documentation before committing to a design.
A mental model for choosing it
Use Salesforce Connect when the following hold:
- The data is large, changes often, or must stay in its home system for governance reasons.
- Users need to see or occasionally edit the data, not run heavy Salesforce automation on every row.
- The external system can answer queries quickly and has an interface that an adapter can use.
Consider copying the data instead when you need it available offline from the source, need full use of Salesforce features that external objects don't support, or the external system is slow or unreliable. A hybrid is also common. You can copy a small, stable subset into Salesforce and leave the long tail as external objects.
The setup sequence ahead
The rest of the tutorial follows the order in which you build a working integration:
- Choose an adapter that suits the external system.
- Create a named credential, and an external credential if you need one, for authentication.
- Create an external data source that uses the adapter and credential.
- Run Validate and Sync to generate external objects from the external schema.
- Grant access with permission sets.
- Add tabs, layouts, and list views.
- Add relationships, run queries, and enable writes where needed.
- Plan for limits and performance.
If you skip a step, the symptoms are usually clear. Without authentication, the data source cannot connect. Without permissions, a user sees no records. Without a tab or list view, users have no obvious place to find the data.
Exercise
A teammate says, "We turned on Salesforce Connect, so now our ERP orders are stored in Salesforce and we can stop calling the ERP." Explain what is wrong with this statement, and name two practical consequences of the correct behavior.
Show answer
Salesforce Connect does not store the orders in Salesforce. It defines external objects, and each query becomes a live callout to the ERP through the adapter and named credential. Two consequences: first, page speed and availability depend on the ERP, so a slow or unavailable ERP slows or breaks the Salesforce pages that read the orders. Second, user activity creates load on the ERP, because list views, reports, and queries each trigger callouts. Other valid consequences are that Salesforce Ids for external records are not stable (use ExternalId) and that some Salesforce features are limited for external objects.
Exercise
You see a SOQL query on Invoice__x that selects ExternalId, DisplayUrl, and Amount__c. What does the __x suffix tell you about the object, and what is the role of ExternalId?
Show answer
The __x suffix marks Invoice__x as an external object, so its rows are read from an external system at query time instead of from Salesforce storage. ExternalId is a standard field that holds the row's unique identifier in the external system. It is the stable key for the record, unlike the generated Salesforce Id.