Newer Version Available

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

External IDs for Salesforce Connect External Objects

When you access external data with a custom adapter for Salesforce Connect, the values of the External ID standard field on an external object come from the DataSource.Column named ExternalId.

Each external object has an External ID standard field. Its values uniquely identify each external object record in your org. When the external object is the parent in an external lookup relationship, the External ID standard field is used to identify the child records.

  • The custom adapter’s Apex code must declare the DataSource.Column named ExternalId and provide its values.
  • Don’t use sensitive data as the values of the External ID standard field or fields designated as name fields, because Salesforce sometimes stores those values.
  • External lookup relationship fields on child records store and display the External ID values of the parent records.
  • For internal use only, Salesforce stores the External ID value of each row that’s retrieved from the external system. This behavior doesn’t apply to external objects that are associated with high-data-volume external data sources.

Important

Example

This excerpt from a sample DataSource.Connection class shows the DataSource.Column named ExternalId.
1override global List<DataSource.Table> sync() {
2        List<DataSource.Table> tables =
3        new List<DataSource.Table>();
4    List<DataSource.Column> columns;
5    columns = new List<DataSource.Column>();
6    columns.add(DataSource.Column.text('title', 255));
7    columns.add(DataSource.Column.text('description',255));
8    columns.add(DataSource.Column.text('createdDate',255));
9    columns.add(DataSource.Column.text('modifiedDate',255));
10    columns.add(DataSource.Column.url('selfLink'));
11    columns.add(DataSource.Column.url('DisplayUrl'));
12    columns.add(DataSource.Column.text('ExternalId',255));
13    tables.add(DataSource.Table.get('googleDrive','title',
14        columns));
15    return tables;
16    }