Sub topic 2
Creating an External Data Source
Assume you know Salesforce objects, permission sets, and basic SOQL. An external data source defines how Salesforce Connect reaches a system that remains outside Salesforce. It combines an adapter, connection details, and authentication.
Create and synchronize the data source
Choose the adapter that matches the external system:
- Use OData 2.0 or OData 4.0 for an OData service.
- Use Cross-Org for another Salesforce org.
- Use a custom Apex adapter when the system needs special request or response handling.
Configure authentication with a named credential and external credential when the system requires authenticated callouts. This keeps endpoint and secret management outside Apex code.
After creating the data source, select Validate and Sync. Salesforce tests the connection and reads the external schema. Select the tables and fields to expose. Salesforce then creates external objects from that selection.
A synchronization can be repeated when the external schema changes. Review proposed changes before applying them because renamed or removed fields can affect layouts, code, and integrations.
Anatomy of an external object
An external object resembles a Salesforce object, but its rows are fetched from the external system when Salesforce queries it. Its API name normally ends in __x. Salesforce Connect also uses special fields:
ExternalIduniquely identifies the external row.DisplayUrllinks to the row in the source system.- Custom fields normally end in
__c.
For example:
SELECT ExternalId, DisplayUrl, Name__c, Price__c
FROM Product__x
WHERE Price__c > 100
LIMIT 20The query can look like ordinary SOQL, but filters and limits may be translated into a live request. The external system remains the system of record.
Grant access with permission sets
Give users access through a permission set rather than changing profiles unnecessarily. Grant:
- Object-level read access, and create, edit, or delete access only when the source supports writes.
- Field-level visibility for required external fields.
- Tab visibility if users need a navigation tab.
Then add the external object to a Lightning app, page layout, or list view. Access still depends on the external system's own authorization rules.
Exercise
What does Validate and Sync create after Salesforce successfully reads the external schema?
Show answer
It creates external objects and fields that represent the selected external tables and columns.