Define an External Data Source for SalesforceConnect—Cross-Org Adapter
- From Setup, enter External Data Sources in the Quick Find 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: Cross-Org.Connect toDetermines which URLis used to connect to the provider org.URLIf you selected Connect toCustom URL, enter the login URL for the provider org.API VersionSelect an API versionthat the provider org supports. The API version determines whichof the provider org’s objects, fields, and types you can accessfrom the subscriber org.Connection TimeoutNumber of seconds to wait for a response from the provider org before timing out. By default, the value isset to the maximum of 120 seconds.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.Enable SearchDetermines whether global searches in the subscriber org also search the external objects’ data, which is stored in the provider org.When selected, you can control which external objects aresearchable by selecting or deselecting Allow Search on each externalobject.Only text, text area, and longtext area fields on external objects can be searched. If an external objecthas no searchable fields, searches on that object return no records.Identity TypeDetermines whether the subscriber org uses one set or multiple sets of credentials to access the provider org. See Identity Type for External Data Sources.
- Select the authentication protocol.If you select Password Authentication, enter the username and password for accessing the external system.If you select OAuth2.0, complete the following fields.FieldDescriptionAuthenticationProviderSelect a Salesforceauthentication provider. See “Configure a SalesforceAuthentication Provider” in the Salesforce Help.Note On a production org, anexternal data source can’t use an authentication provider that directsauthorization or token requests to a sandbox org. Similarly, on a sandboxorg, an external data source can’t use an authentication provider thatdirects authorization or token requests to a production org.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.
- If you select OAuth2.0, complete the following fields.FieldDescriptionAuthenticationProviderSelect a Salesforceauthentication provider. See “Configure a SalesforceAuthentication Provider” in the Salesforce Help.Note On a production org, anexternal data source can’t use an authentication provider that directsauthorization or token requests to a sandbox org. Similarly, on a sandboxorg, an external data source can’t use an authentication provider thatdirects authorization or token requests to a production org.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. If you instead receive an error message, refer to the following documents.“Status Codes and Error Responses” in the REST API Developer GuideThe “API Fault Element,” “ExceptionCode,” “Error,” and “StatusCode” sections of “Core Data Types Used in API Calls” in the SOAP API Developer Guide
- “Status Codes and Error Responses” in the REST API Developer Guide
- The “API Fault Element,” “ExceptionCode,” “Error,” and “StatusCode” sections of “Core Data Types Used in API Calls” in the SOAP API Developer Guide
- 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—Cross-Org 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—Cross-Org Adapter