Newer Version Available

This content describes an older version of this product. View Latest

External Objects

External objects are supported in API version 32.0 and later. External objects are similar to custom objects, but external object record data is stored outside your Salesforce organization. For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts.

External objects are available with Lightning Connect and Files Connect. Each external object is associated with an external data source definition in your Salesforce organization.

An external data source specifies how to access an external system. Lightning Connect uses external data sources to access data that's stored outside your Salesforce organization. Files Connect uses external data sources to access third-party content systems. External data sources have associated external objects, which your users and the Force.com platform use to interact with the external data and content.

By accessing record data on demand, external objects always reflect the current state of the external data. You don't have to manage a copy of that data in Salesforce, so you're not wasting storage and resources keeping data in sync.

External objects are best used when you have a large amount of data that you can’t or don’t want to store in your Salesforce organization, and you only need to use a small amount of data at any one time.

See “Define External Objects” in the Salesforce Help for how to create and modify external objects.

Naming Conventions for External Objects

Object names must be unique across all standard, custom, and external objects in the org.

In the API, the names of external objects are identified by a suffix of two underscores immediately followed by a lowercase “x” character. For example, an external object named “ExtraLogInfo” in the Salesforce user interface is seen as ExtraLogInfo__x in that organization's WSDL.

External Object Relationships

External objects support standard lookup relationships, which use the 18-character Salesforce record IDs to associate related records with each other. However, data that’s stored outside your Salesforce org often doesn’t contain those record IDs. Therefore, two special types of lookup relationships are available for external objects: external lookups and indirect lookups. See ”External Object Relationships” in the Salesforce Help for details.

Feature Support for External Objects

Most of the Salesforce features that support custom objects also support external objects. However, there are exceptions, and some features have special limitations and considerations for external objects. See the following topics in the Salesforce Help.
  • Salesforce Compatibility Considerations for Lightning Connect—All Adapters
  • Considerations for Lightning Connect—All Adapters

Lightning Connect Adapters

Lightning Connect uses a protocol-specific adapter to connect to an external system and access its data. This table describes the available adapters.
Lightning Connect Adapter Description
OData 2.0

OData 4.0

Uses Open Data Protocol to access data that’s stored outside Salesforce. The external data must be exposed via OData producers.
Salesforce Uses the Force.com REST API to access data that’s stored in other Salesforce orgs.
Custom adapter created via Apex You use the Apex Connector Framework to develop your own custom adapter when the other available adapters aren’t suitable for your needs.

A custom adapter can obtain data from anywhere. For example, some data can be retrieved from anywhere in the Internet via callouts, while other data can be manipulated or even generated programmatically.

For more information about Lightning Connect, see “Lightning Connect” in the Salesforce Help.

For details on using the Apex Connector Framework, see “Lightning Connect” and “DataSource Namespace” in the Force.com Apex Code Developer’s Guide.