In scenarios where data on a Salesforce record doesn’t necessarily need to reside within Salesforce (pulled on -demand from one or more systems or data sources), Salesforce Connect can be used to effectively present data to a user as if it resides within Salesforce (having the same user interface and a degree of interactivity). Salesforce Connect uses the principle of adapters to bring in data from an external source. For example, there are adapters for OData 2.0, OData 4.0, and Cross-Org (Salesforce to Salesforce) available out of the box, and there is a framework for writing a custom adapter available in Apex.
If a middleware solution (such as MuleSoft) is not available (or indeed not desirable), then point-to-point integrations to external systems for the purpose of data access may be necessary, and that’s a perfect use case for Salesforce Connect.
When using Salesforce Connect, external objects (as you’ll remember from Chapter 2, Data Modeling and Database Design) are mapped to data tables in external systems. This data can be interrogated and used by users when performing operations in Salesforce such as search, associating data in external systems with data held within Salesforce (using either an external or indirect lookup relationship), or viewing a record feed.
By default, external data sources are read-only in Salesforce, but it is possible to make them writable. For example, imagine there was order data being viewed from SAP, associated with a custom account held in Salesforce. It is possible to enable the external data source as a writable external object, so that new orders could be created from Salesforce, writing back to SAP, and creating the order there.
When setting up Salesforce Connect, an authentication mechanism may be required so that Salesforce can communicate securely with the other system. This may take the form of a username/password of the user Salesforce will use to perform queries in the external system, or it may be a more sophisticated setup, such as using Open Authentication (OAuth) with an external authentication service, such as Microsoft Azure Active Directory.
External data retrieval using the OData 2.0 or OData 4.0 adapters
OData is a protocol built upon Representational State Transfer (REST). As defined at https:// www.odata.org, OData is described as an open protocol to allow the creation and consumption of queryable and interoperable REST-ful APIs in a simple and standard way.
If an external data source can be exposed as an OData RESTful web service, then the OData 2.0 or OData 4.0 Salesforce Connect adapter can be used to allow for its display in the Salesforce UI.
External data retrieval using the Cross-Org adapter
It is possible to pull in data from another Salesforce instance using the Cross-Org adapter for Salesforce Connect. This uses the Lightning Platform REST API to access data stored in another Salesforce instance (also referred to as an org or organization), although the implementation is hidden from the Salesforce administrator setting up the Salesforce Connect Cross-Org adapter. It’s therefore possible to pull data held in one Salesforce instance to another.
If, for instance, your company acquired another company that also used Salesforce, yet it was decided that the acquired company would continue to have a degree of independence and keep their separate Salesforce system, then the opportunity data could be pulled into your Salesforce instance so that a more complete set of sales data could be reported on.