Skip to main content

Table of Contents

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?

  1. External data should appear as External Objects but the source is not OData.
  2. You need full control over how queries, search, and CRUD map to the external API.
  3. Data virtualization (no replication) with custom logic/transformation.

How It Works

Create two Apex classes in the DataSource namespace:

ClassRole
DataSource.ProviderDeclares the adapter's capabilities and authentication.
DataSource.ConnectionHandles 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.

Documentation

  1. Get Started with the Apex Connector Framework
  2. Salesforce Connect - Apex Connector Framework