Newer Version Available

This content describes an older version of this product. View Latest

Connection Class

Extend this class to enable your Salesforce organization to sync the external system’s schema and to handle queries and searches of the external data.

Namespace

DataSource

Usage

Your DataSource.Connection and DataSource.Provider classes compose a custom adapter for Lightning Connect.

Changing the sync method on the DataSource.Connection class doesn’t automatically resync any external objects.

Connection Methods

The following are methods for Connection.

query(queryContext)

Gets invoked by a SOQL query of an external object. A SOQL query is generated and executed when a user visits an external object’s list view or record detail page in Salesforce. Returns the results of the query.

Signature

public DataSource.TableResult query(DataSource.QueryContext queryContext)

Parameters

queryContext
Type: DataSource.QueryContext
Represents the query to run against a data table.

Return Value

Type: DataSource.TableResult

sync()

Gets invoked when an administrator clicks Validate and Sync on the external data source detail page. Returns a list of tables that describe the external system’s schema.

Signature

public List<DataSource.Table> sync()

Return Value

Type: List<DataSource.Table>

Each returned table can be used to create an external object in Salesforce. On the Validate External Data Source page, the administrator views the list of returned tables and selects which tables to sync. When the administrator clicks Sync, an external object is created for each selected table. Also, each column within the selected tables becomes a field in the external object.