Loading

'An error occurred while connecting to the external system' in ODataService

Date de publication: Oct 13, 2022
Description
Some customers who have Search enabled on an External Data Source may encounter the error

'ODataService: An error occurred while connecting to the external system. Please try again, or contact your administrator about this error. Attempted to reach this URL: https://mycompany.com/ExternalService/vwExternalObject1'

or similar when attempting to search for a record associated to an external object through the Global Search.

Assuming that you have an external data source available and you have external objects already created, typical steps to reproduce this issue would be the following:
  1. Enable search on the External Data Source by going to Setup | Build | Develop | External Data Sources in Classic or by Setup | Data | External Data Sources in LEX. Then click Edit, under 'Parameters,' check 'Enable Search' and Save.
  2. Search for a External Object record using Search
  3. You will see the following before hitting the error above:
Searching vwExternalObject1...
Searching vwExternalObject2...
Searching vwExternalObject3..

[Note : vwExternalObject1,vwExternalObject2... are the name of your External Objects]



 
Résolution
  • There is no indexing locally on Salesforce for external objects. External objects are all stored on an external system and thus rely on search capabilities of that external system. 
  • If search is enabled for the data source, Salesforce simply does a call out to the endpoint for each external object backed by that data source and displays the results returned by the data source. The checkbox mentioned in step 1 above controls whether Salesforce will make the call out to find search results.
  • Click "Enable Search" in an External Data Source to enables SOSL and Salesforce global searches for the external data. To control which external objects are searchable, select or deselect “Allow Search” on each external object.
  • There are efforts in motion where we are working on making it even more clear that certain problems may be caused on the external system side in an upcoming release (safe harbor). Until then, a general working rule is if the error message contains "Attempted to reach a URL", something about the endpoint or URL, or some sort of HTTP error code, it can be assumed that this is a problem with the external system.
  • More to the point if you see an "Error received: 500" that is an HTTP code error coming from the external system.  With OData it usually has to do with the external system not following OData specification, a problem with a gateway redirecting and causing issues with the request, or especially with search, it not being configured since it is not standard.
  • The workaround here is to disable search on the External Data Sources settings by unchecking 'Enable Search'
  • Note that Salesforce cannot disable indexing on external objects based on the above at this time.
Numéro d’article de la base de connaissances

000387806

 
Chargement
Salesforce Help | Article