Salesforce Connect and external objects
Data virtualization: external objects backed by OData, cross-org or custom Apex adapters, external and indirect lookups, and what you give up compared with copying the data.
Simple explanation
Salesforce Connect shows data that lives in another system as external objects (API names end in __x). Records are fetched live when a user or code asks for them. Nothing is stored in Salesforce.
Adapters
- OData 2.0 / 4.0: the external system (or middleware such as MuleSoft) exposes an OData endpoint.
- Cross-org: read data from another Salesforce org through its APIs.
- Custom adapter with the Apex Connector Framework (
DataSource.Connection,DataSource.Provider) for any REST API. - Additional adapters for specific platforms exist and change by release β verify current list.
Relationships
- External lookup: an external object looks up to another external object (by external ID).
- Indirect lookup: an external object links to a standard or custom object through a unique external ID field on the Salesforce record (for example order history β Account by
ERP_Id__c). - Standard and custom objects can look up to external objects too.
What works: related lists on records, list views, SOQL (translated into calls to the source), search (if enabled), LWC and Apex access, and writable external objects where the adapter supports it.
What you give up: triggers and record-triggered flows, most reporting features, rollups, sharing rules (access is controlled by object permissions and the external system), and performance that depends on the source system.
Real-world analogy
External objects are a window into the neighbour's shop. You can see what's on their shelves right now and even ask them to change something, but you don't own the stock, you can't rearrange it, and if they close their shutters, the window shows nothing.
Worked example
Order history (300 million rows in the data warehouse) shown on the Account page:
- MuleSoft exposes an OData 4.0 endpoint over the warehouse's order view, with paging and filtering pushed down to SQL.
- External object
Order_History__xwith an indirect lookup fromCustomer_Id__ctoAccount.ERP_Id__c. - A related list on Account shows the latest orders; a filter on date keeps queries fast.
- No storage cost, always current. In exchange, the team accepts that order history can't trigger automation and isn't available when the warehouse is down (the page shows an error message rather than failing).
Querying it from Apex looks like normal SOQL:
List<Order_History__x> recent = [
SELECT ExternalId, Order_Number__c, Order_Date__c, Total__c
FROM Order_History__x
WHERE Customer_Id__c = :account.ERP_Id__c AND Order_Date__c = LAST_N_DAYS:90
ORDER BY Order_Date__c DESC
LIMIT 50
];
Diagram
Key points
- External objects (
__x) read data live from the source; no storage. - Adapters: OData 2.0/4.0, cross-org, custom Apex Connector Framework.
- External lookup (to external objects) and indirect lookup (to Salesforce records by external ID).
- Works in record pages, list views, SOQL, Apex and LWC; writable where supported.
- No triggers or record-triggered flows, limited reporting, performance depends on the source.
- Choose virtualization for large, read-mostly, rarely reported data.
Limits and gotchas
- Each page view can trigger callouts; there are hourly limits on OData callouts per org β verify current value. Cache or paginate.
- Filters must be pushed down to the source. A source that can't filter or page efficiently makes pages slow.
- Licensing: Salesforce Connect is a paid add-on in most editions β verify.
- Security: decide between a single integration identity (named principal) and per-user authentication to the source; per-user is stronger but needs identity mapping.
- If users need to report on the data or automate on it, copying (batch sync or Data 360) may be better.
π€ How to say this in an interview
Bring up Salesforce Connect whenever an interviewer describes large, external, read-mostly data ("10 years of transactions"). Then show judgement: name what you lose (automation, reporting, availability) and when you'd copy a summary instead.
Common follow-ups
The business wants a report of total order value per account from external objects. What do you say?
Reports on external objects are limited and slow. Calculate the totals in the source or middleware and sync them to an Account field (batch sync), or use Data 360 or the warehouse for analytics. Keep the external object for drill-down.
Can you write back through external objects?
Yes, if the adapter and the external system support it (writable external objects). Writes are synchronous calls to the source, so handle errors and conflicts, and remember there are no triggers on the external object.