Apex Developer Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Summer '15 (API version 34.0)
Spring '15 (API version 33.0)
Winter '15 (API version 32.0)
Spring '14 (API version 30.0)
AuthenticationCapability Enum
AuthenticationProtocol Enum
Capability Enum
DataType Enum
FilterType Enum
IdentityType Enum
OrderDirection Enum
QueryAggregation Enum
DataSource Exceptions
Glossary
Newer Version Available
DataSource Namespace
The DataSource namespace provides the classes for
the Apex Connector Framework. Use the Apex Connector
Framework to develop a custom
adapter for Salesforce
Connect. Then connect your Salesforce
organization to any data anywhere via the Salesforce Connect custom adapter.
The following are the classes in the DataSource namespace.
-
AsyncDeleteCallback Class
A callback class that the Database.deleteAsync method references. Salesforce calls this class after the remote deleteAsync operation is completed. This class provides the compensating transaction in the completion context of the delete operation. Extend this class to define the actions to execute after the remote delete operation finishes execution. -
AsyncSaveCallback Class
A callback class that the Database.insertAsync or Database.updateAsync method references. Salesforce calls this class after the remote operation is completed. This class provides the compensating transaction in the completion context of the insert or update operation. Extend this class to define the actions to execute after the remote insert or update operation finishes execution. -
AuthenticationCapability Enum
Specifies the types of authentication that can be used to access the external system. -
AuthenticationProtocol Enum
Determines what type of credentials are used to authenticate to the external system. -
Capability Enum
Declares which functional operations the external system supports. Also specifies required endpoint settings for the external data source definition. -
Column Class
Describes a column on a DataSource.Table. This class extends the DataSourceUtil class and inherits its methods. -
ColumnSelection Class
Identifies the list of columns to return during a query or search. -
Connection Class
Extend this class to enable your Salesforce org to sync the external system’s schema and to handle queries, searches, and write operations (upsert and delete) of the external data. This class extends the DataSourceUtil class and inherits its methods. -
ConnectionParams Class
Contains the credentials for authenticating to the external system. -
DataSourceUtil Class
Parent class for the DataSource.Provider, DataSource.Connection, DataSource.Table, and DataSource.Column classes. -
DataType Enum
Specifies the data types that are supported by the Apex Connector Framework. -
DeleteContext Class
An instance of DeleteContext is passed to the deleteRows() method on your Database.Connection class. The class provides context information about the delete request to the implementor of deleteRows(). -
DeleteResult Class
Represents the result of a delete operation on an sObject record. The result is returned by the DataSource.deleteRows method of the DataSource.Connection class. -
Filter Class
Represents a WHERE clause in a SOSL or SOQL query. -
FilterType Enum
Referenced by the type property on a DataSource.Filter. -
IdentityType Enum
Determines which set of credentials is used to authenticate to the external system. -
Order Class
Contains details about how to sort the rows in the result set. Equivalent to an ORDER BY statement in a SOQL query. -
OrderDirection Enum
Specifies the direction for sorting rows based on column values. -
Provider Class
Extend this base class to create a custom adapter for Salesforce Connect. The class informs Salesforce of the functional and authentication capabilities that are supported by or required to connect to the external system. This class extends the DataSourceUtil class and inherits its methods. -
QueryAggregation Enum
Specifies how to aggregate a column in a query. -
QueryContext Class
An instance of QueryContext is provided to the query method on your DataSource.Connection class. The instance corresponds to a SOQL request. -
QueryUtils Class
Contains helper methods to locally filter, sort, and apply limit and offset clauses to data rows. This helper class is provided for your convenience during early development and tests, but it isn’t supported for use in production environments. -
ReadContext Class
Abstract base class for the QueryContext and SearchContext classes. -
SearchContext Class
An instance of SearchContext is provided to the search method on your DataSource.Connection class. The instance corresponds to a search or SOSL request. -
SearchUtils Class
Helper class for implementing search on a custom adapter for Salesforce Connect. -
Table Class
Describes a table on an external system that the Salesforce Connect custom adapter connects to. This class extends the DataSourceUtil class and inherits its methods. -
TableResult Class
Contains the results of a search or query. -
TableSelection Class
Contains a breakdown of the SOQL or SOSL query. Its properties represent the FROM, ORDER BY, SELECT, and WHERE clauses in the query. -
UpsertContext Class
An instance of UpsertContext is passed to the upsertRows() method on your Datasource.Connection class. This class provides context information about the upsert request to the implementor of upsertRows(). -
UpsertResult Class
Represents the result of an upsert operation on an external object record. The result is returned by the upsertRows method of the DataSource.Connection class. -
DataSource Exceptions
The DataSource namespace contains exception classes.