# How does Salesforce Connect OData facilitate seamless cross-org data visibility without data duplication?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, Salesforce Connect, Cross-Org OData

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-salesforce-connect-odata-facilitate-seamless-cross-org-data-visibility-without-data-duplication

## Answer

**Basics:** Normally, sharing data between orgs means ETL, replication and sync jobs, which create latency, storage cost and duplicates. Salesforce Connect instead defines an External Data Source and external objects (API names end in `__x`). Users see them in list views, related lists, record pages, search and reports, but each view triggers a live call to the remote system. You use it when data must stay in the system of record, is large, or changes too fast to replicate.

**How it works:**
1. Remote side: for cross-org, a user with API access in the source org; for OData, an endpoint that returns OData metadata.
2. In the subscriber org, create a Named Credential (or auth provider) for authentication.
3. Setup > External Data Sources: choose the type (Salesforce Connect: Cross-Org, OData 2.0, OData 4.0, or custom Apex adapter), pick identity type (Named Principal or Per User) and set the endpoint.
4. Click Validate and Sync to generate external objects from the remote metadata.
5. Grant object and field permissions, then expose them via tabs, page layouts and related lists.
6. Link data with External Lookup (external child to standard parent), Indirect Lookup (standard child to external parent, matched on an External ID field), or standard Lookup.

**Advanced / deep dive:** Every query becomes a callout, so latency and the remote API limits become your problem. Cross-org queries consume API calls in the source org. External objects do not use Salesforce sharing; access is controlled by object permissions plus whatever the remote credentials allow, so Per User authentication is the way to inherit row-level security. Writable external objects (write access enabled on the data source) send edits back through callouts. Capabilities are narrower than native objects: limited SOQL (relationship queries and some aggregates and filters are restricted), no standard sharing rules, and no native storage-based features. If you need offline use, heavy joins, or bulk analytics, replicate with Data Cloud, Bulk API ETL or Platform Events/CDC instead. A custom adapter (Apex `DataSource.Connection` and `DataSource.Provider`) covers REST/SOAP systems that are not OData. Salesforce Connect is an add-on license for most editions; verify pricing and edition availability.

**Code / config example:**
```apex
// External objects are queried like any sObject, but each query is a live callout.
List<Remote_Case__x> rows = [
    SELECT ExternalId, Subject__c, Status__c
    FROM Remote_Case__x
    WHERE Status__c = 'Open'
    LIMIT 100   // always bound the result set; paging is server-driven
];
```

**Hidden gotchas & must-remember points:**
- The Cross-Org adapter is the right tool between Salesforce orgs; people wrongly say "OData" for it.
- External object queries count as callouts toward the 100-callout and callout-time limits in Apex.
- Triggers and workflow-style automation on external objects are limited; data is not stored locally, so reports and sharing behave differently.
- Reports over external objects are slow and limited; do not treat them as warehouse tables.
- Server-driven vs client-driven paging on OData sources affects large result sets.
- An External ID standard field is required for indirect lookups to match.

**Best practice:** Use external objects for low-volume, on-demand reads of reference data; replicate data you need to join, report on heavily or use offline.

---
Source: ForceChallenges · last updated 2026-11-02
