Newer Version Available
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.
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 }