Integration - Apex Connector Framework
Build a custom adapter for Salesforce Connect when
no standard adapter (OData, cross-org) fits the external source. You write Apex
to expose external data as External Objects (__x) - the data stays in the
source system and is read (and optionally written) live via callouts.
When to Use the Apex Connector Framework?
- External data should appear as External Objects but the source is not OData.
- You need full control over how queries, search, and CRUD map to the external API.
- Data virtualization (no replication) with custom logic/transformation.
How It Works
Create two Apex classes in the DataSource namespace:
| Class | Role |
|---|---|
DataSource.Provider | Declares the adapter's capabilities and authentication. |
DataSource.Connection | Handles sync (metadata), query, search, and DML against the external system. |
After deployment, the custom adapter appears in Setup and is selectable when creating an External Data Source.
Considerations
- Subject to Apex callout limits and standard Apex governor limits.
- Data is virtual (not stored) - same high-data-volume caveats as Salesforce Connect.
- Writable external objects require implementing the DML methods.
- Use a standard adapter (OData 4.01, cross-org) first; only build custom when needed.