Loading
Prepare for Email to Become the Default Login ExperienceRead More
Extend Salesforce with Clicks, Not Code
External IDs for External Objects in Salesforce Connect—Custom Adapter

External IDs for External Objects in Salesforce Connect—Custom Adapter

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.

Required Editions

Available in: both Salesforce Classic and Lightning Experience (not for high-data-volume external objects)

Available in: Developer Edition

Available for an extra cost in: Enterprise, Performance, and Unlimited Editions

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.

Important
Important
  • 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.
Example
Example This excerpt from a sample DataSource.Connection class shows the DataSource.Column named ExternalId.

    override global List<DataSource.Table> sync() {
        List<DataSource.Table> tables =
        new List<DataSource.Table>();
    List<DataSource.Column> columns;
    columns = new List<DataSource.Column>();
    columns.add(DataSource.Column.text('title', 255));
    columns.add(DataSource.Column.text('description',255));
    columns.add(DataSource.Column.text('createdDate',255));
    columns.add(DataSource.Column.text('modifiedDate',255));
    columns.add(DataSource.Column.url('selfLink'));
    columns.add(DataSource.Column.url('DisplayUrl'));
    columns.add(DataSource.Column.text('ExternalId',255));
    tables.add(DataSource.Table.get('googleDrive','title',
        columns));
    return tables;
    }
 
Loading
Salesforce Help | Article