Define an External Data Source for Salesforce Connect—CustomAdapter
- From Setup, enter External Data Sources in the QuickFind box, then select External Data Sources.
- Click New External Data Source, or clickEdit to modify an existing external data source.
-
Complete the fields.FieldDescriptionLabelA user-friendly name for theexternal data source. The label is displayed in the Salesforceuser interface, such as in list views.If you set Identity Type to Per User, this label appears when your users view or edit their authentication settings for external systems.NameA unique identifier that’sused to refer to this external data source definition throughthe API.The name can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.TypeSelect Salesforce Connect: Custom—
.If you change and save a DataSource.Connection class, resave thecorresponding DataSource.Providerclass. Otherwise, when you define the external data source, the customadapter doesn’t appear as an option for the Type field.URLURL of the external system.Available only when the DataSource.Provider class declares theREQUIRE_ENDPOINT capability. If the class also declares the REQUIRE_HTTPS capability, the URL must begin with https://.If the endpoint is defined in a named credential, enter the named credential URL. A named credential URL contains the scheme callout:, the name of the named credential, and an optional path. For example: callout:My_Named_Credential/some_path.You can append a query string to a named credential URL. Use a question mark (?) as the separator between the named credential URL and the query string. For example: callout:My_Named_Credential/some_path?format=json.Writable External ObjectsLets the Lightningplatform and users in this org create, update, and deleterecords for external objects associated with the external datasource. The external object data is stored outside the org. Bydefault, external objects are read only.High Data VolumeSalesforce enforcesrate limits for retrieving and viewing data from externalsystems. If your org hits rate limits when accessing external objects, consider selecting the High Data Volume option on the associated external data sources. Doing so bypasses most rate limits, but some special behaviors and limitations apply. See High Data Volume Considerations for Salesforce Connect—CustomAdapters.CertificateIf you specify acertificate, your Salesforce org supplies it when establishingeach two-way SSL connection with the external system. The certificate is used for digital signatures, which verify that requests are coming from your Salesforce org.Available only when the DataSource.Provider class declares the CERTIFICATE authentication capability.Identity TypeDetermines whetheryou're using one set or multiple sets of credentials to accessthe external system. See Identity Type for External Data Sources.Available only when the DataSource.Provider class declares theBASIC or OAUTH authentication capability. - Select the authentication protocol.If you select Password Authentication, enter the username and password for accessing the external system.Password authentication is available only when the DataSource.Provider class declares the BASIC authentication capability.If you select OAuth2.0, complete the following fields.OAuth 2.0 is available only when the DataSource.Provider class declares theOAUTH authentication capability.FieldDescriptionAuthenticationProviderChoose theprovider. See External Authentication Providers.ScopeSpecifies the scope ofpermissions to request for the access token.Your authentication provider determines the allowed values. See Use the Scope Parameter.NoteThe value that you enter replaces the DefaultScopes value that’s defined in the specified authentication provider.Whether scopes are defined can affect whether each OAuth flow prompts the user with a consent screen.We recommend that you request a refresh token or offline access. Otherwise, when the token expires, you lose access to the external system.StartAuthentication Flow on SaveToauthenticate to the external system and obtain an OAuth token,select this checkbox.This authentication process is called an OAuth flow.When you click Save, the external system prompts you to log in. After successful login, the external system grants you an OAuth token for accessing its data from this org.Redo the OAuth flow when you need a new token—for example, if the token expires—or if you edit the Scope or AuthenticationProvider fields.
- If you select Password Authentication, enter the username and password for accessing the external system.Password authentication is available only when the DataSource.Provider class declares the BASIC authentication capability.
- If you select OAuth2.0, complete the following fields.OAuth 2.0 is available only when the DataSource.Provider class declares theOAUTH authentication capability.FieldDescriptionAuthenticationProviderChoose theprovider. See External Authentication Providers.ScopeSpecifies the scope ofpermissions to request for the access token.Your authentication provider determines the allowed values. See Use the Scope Parameter.NoteThe value that you enter replaces the DefaultScopes value that’s defined in the specified authentication provider.Whether scopes are defined can affect whether each OAuth flow prompts the user with a consent screen.We recommend that you request a refresh token or offline access. Otherwise, when the token expires, you lose access to the external system.StartAuthentication Flow on SaveToauthenticate to the external system and obtain an OAuth token,select this checkbox.This authentication process is called an OAuth flow.When you click Save, the external system prompts you to log in. After successful login, the external system grants you an OAuth token for accessing its data from this org.Redo the OAuth flow when you need a new token—for example, if the token expires—or if you edit the Scope or AuthenticationProvider fields.
- The value that you enter replaces the DefaultScopes value that’s defined in the specified authentication provider.
- Whether scopes are defined can affect whether each OAuth flow prompts the user with a consent screen.
- We recommend that you request a refresh token or offline access. Otherwise, when the token expires, you lose access to the external system.
- Click Save.
- Click Validate and Sync, and confirm that the connection issuccessful.This step also invokes the sync() method on the DataSource.Connection class to obtain the list of tables that you can sync to create external objects and their fields.
- Optionally, select tables and click Sync to do the following for each selected table.Automatically create aSalesforce external object.Automatically create a customfield for each table column that’s compatible with a Salesforcemetadata field type.Note Before you sync, make sure that you understand the considerations that are described in these topics.Sync Considerations for Salesforce Connect—All AdaptersSync Considerations for Salesforce Connect—Custom AdapterYou can instead choose to manually create the external objects and custom fields that map to the external data. Doing so lets you customize the external object names, decide which table columns to create custom fields for, and customize the custom field names. However, this approach takes longer and requires manual maintenance.
- Automatically create aSalesforce external object.
- Automatically create a customfield for each table column that’s compatible with a Salesforcemetadata field type.
- Sync Considerations for Salesforce Connect—All Adapters
- Sync Considerations for Salesforce Connect—Custom Adapter