---
schema_version: "1"
id: 78d5e1bb41f7936ebe01b1e15f819a494064c9d12d27d1201516c9768577f3c7
title: 與 Salesforce 的資料整合
collection: architect
version: next
locale: zh-tw
portal_url: https://docs.salesforce.com/architect/next/zh-tw/decision-guides/guides/data-integration.md
canonical_url: https://staging.architect.salesforce.com/docs/architect/zh-tw/decision-guides/guide/data-integration.html
source_site: staging.architect.salesforce.com
content_type: documentation
content_hash: ed53b470a7c88f69d0382d561e83c97681ac3cfcdc32e78962fc987e3627b42c
products:
  - 決策指南
  - Architect Site Content Repo
updated_at: 2025-10-01T00:00:00Z
---
## 指南概觀

在 Salesforce 與外部系統之間存取、同步化及共用資料的方式有多種。但並非每個工具都適合您的特定專案。本指南逐步引導您瞭解 Salesforce 提供的資料整合工具。此外也會針對最適合特定使用個案的工具 (或工具組合) 提供建議,以及針對特定情況避免使用之工具的指引。

此決策指南著重於涉及 Salesforce 的資料層級整合。具體而言,它涵蓋下列資料整合使用個案:

- Salesforce 至外部系統
- 外部系統對 Salesforce
- Salesforce 組織對 Salesforce 組織

這些僅是 Salesforce 結構設計師面對的整合挑戰子集,因此我們計畫新增更多決策指南,專注於事件驅動的整合、使用流程整合建立有效的客戶或員工面向工作流程等。最後,請務必注意,此處描述的許多工具和方法可用來解決整合在整個企業中的挑戰,但此類用途超出本指南的範圍。

### 接待時間

- **避免不必要的資料複寫。**除非資料絕對需要位於 Salesforce 中,否則請考慮改為使用 Salesforce Connect 虛擬化資料。組織中的資料越多,最終會導致資料量越大,這會對[績效](/docs/architect/zh-tw/well-architected/guide/reliable#績效)造成負面影響,並增加技術負債。如果您的資料已位於 Salesforce 中且您在外部系統中需要資料,請避免將資料複製到外部系統,除非有絕對必要。請改為讓外部系統透過 Salesforce API 存取資料。
- **如果可用,請使用 MuleSoft 或其他 Enterprise Service Bus (ESB) 或 Extract-Transform-Load (ETL) 解決方案,且為您現有的區域範圍的一部分。**由於這些工具是為了協助支援資料移轉和轉換而建立,因此通常具有強大的功能,可讓您在整個企業中重複使用整合、維持更強大的管治,並集中管理整合。在此指南中,無論建議使用 MuleSoft Anypoint 的任何位置,請考量您現有的 ESB/ETL 解決方案是否足夠。
- **使用 Data 360 和 Data Cloud One 協調不同來源的資料。**透過 Customer 360 資料模型、身分解析、資料聯邦和其他功能,Data 360 會將 Salesforce 和其他外部系統的資料合併至您客戶的統一檢視。此外,透過 [Data Cloud One](/docs/architect/zh-tw/fundamentals/guide/data360_integration_patterns_and_practices.html#unified-multi-org-data-platform-with-data-cloud-one),其他 Salesforce 組織中的使用者可以透過資料空間安全地存取從 Data 360 虛擬共用的資料。
- 使用 **Data 360 動作和啟用在組織之間移動資料。**將不同組織的資料從 Data 360 移入後,資料 [動作和啟用](/docs/architect/zh-tw/fundamentals/guide/data360_integration_patterns_and_practices.html#data-activation-patterns--data-outbound)可以將資料同步至其他組織。此方法對於與 Marketing Cloud 組織的整合而言非常有用。
- 使用 **MuleSoft Anypoint.**MuleSoft Anypoint 可用來使用 Connect API 和 Data Graph API 從 Data 360 提取資料,並將其移至另一個 Salesforce 組織。若沒有 Data 360,則當需要在組織之間移動資料而不需要在 Data 360 中複製時,也可使用 MuleSoft Anypoint。
- **如果您選擇使用「輸出傳訊」建立,請特別小心。**Salesforce 會在目前的功能容量內繼續支援「輸出傳訊」,但不會計畫進一步投資此技術。
- **針對所有整合一律建議使用「僅 API」設定檔整合使用者授權。**Salesforce 也建議使用「外部用戶端應用程式」(偏好連線應用程式或 SOAP 登入) 作為所有整合適當允許的 AuthN 和 AuthZ 模式。

## 選擇資料整合工具的常見考量事項

在深入瞭解可用的資料整合工具之前,選擇工具時,請務必記住幾個常見考量事項。如同結構一般,對於每個業務挑戰沒有指示性回答。如果您在進行整合選擇時說出「這取決於」,則表示您處於正確的位置。

<table>
    <thead>
        <tr>
            <th>考量區域</th>
            <th>常見問題</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>現有工具與橫向</td>
            <td>是否有現有的 ESB 或 ETL 解決方案?相關資料是否具有法規或規範需求?您嘗試整合的系統位於何處 (雲端或內部部署中)?</td>
        </tr>
        <tr>
            <td>資料流程 (時間點、預期的使用者體驗、方向性)</td>
            <td>資料是否需要同步、非同步移動,還是可批次/排程?資料複寫是否必要?哪個系統應該是事實來源?什麼是資料來源?什麼是目標目的地?使用者互動是否必要?使用者是否需要查看整合的結果?例外狀況處理 (重試、通知、失敗) 的需求為何?系統應如何緊密連接?</td>
        </tr>
        <tr>
            <td>實作</td>
            <td>非 Salesforce 系統的工作層級為何?哪些小組負責提供整合?他們偏好使用哪些工具?</td>
        </tr>
        <tr>
            <td><a href="/docs/architect/zh-tw/well-architected/guide/intentional#永續性">永續性</a></td>
            <td>哪些小組預期會維護整合?他們目前擁有哪些技能?他們未來需要哪些技能?一段時間內的總擁有成本為何?使用低度或專業程式碼工具測試、除錯、疑難排解的能力有多重要?</td>
        </tr>
        <tr>
            <td><a href="/docs/architect/zh-tw/well-architected/guide/reliable#資料量">資料量</a></td>
            <td>整合中涉及多少資料?您是否要使用 <a href="https://trailhead.salesforce.com/content/learn/modules/large-data-volumes">大型資料量</a> (LDV)?大量變更的發生頻率為何?singleton 更新的影響為何?它們會發生多少次?</td>
        </tr>
        <tr>
            <td>限制</td>
            <td>資料是否需要進行複雜轉換?資料是否必須從多個來源系統合併?每位使用者整合的發生頻率為何?使用者總數為何?您是否已預先計畫大量資料載入 (例如:新例項的初始資料載入)?</td>
        </tr>
    </tbody>
</table>

## 產品比較

以下是資料整合可用工具的概觀,以及開始評估每個選項的一些考量事項。下列區段包含深入的使用個案,以及這些工具功能的相關詳細資料。

<table>
    <thead>
        <tr>
            <th></th>
            <th>從 Salesforce 至外部系統</th>
            <th>從外部系統到 Salesforce</th>
            <th>執行</th>
            <th>需要其他授權</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>Apex 動作</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否</td>
        </tr>
        <tr>
            <td><strong>變更資料取</strong>取</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-no">不提供</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否*</td>
        </tr>
        <tr>
            <td><strong>自訂 Apex (REST 和 SOAP Web 服務)</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否</td>
        </tr>
        <tr>
            <td><strong>外部服務</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-no">不提供</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否</td>
        </tr>
        <tr>
            <td><strong>Heroku Connect</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>是</td>
        </tr>
        <tr>
            <td><strong>Data 360</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>是</td>
        </tr>
        <tr>
            <td><strong>MuleSoft Anypoint</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>是</td>
        </tr>
        <tr>
            <td><strong>原生 Salesforce API</strong></td>
            <td class="guide-table-no">不提供</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否</td>
        </tr>
        <tr>
            <td><strong>Omniscript</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-no">用戶端***</td>
            <td>是</td>
        </tr>
        <tr>
            <td><strong>OmniStudio 整合程序</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>是</td>
        </tr>
        <tr>
            <td><strong>輸出傳訊</strong></td>
            <td>不是理想</td>
            <td class="guide-table-no">不提供</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否</td>
        </tr>
        <tr>
            <td><strong>平台事件</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>否**</td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect/外部物件</strong></td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">可用</td>
            <td class="guide-table-ok">伺服器端</td>
            <td>是</td>
        </tr>
    </tbody>
</table>

[\* 大量變更資料摘取事件使用個案需要附加元件](https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_allocations.htm)

[\*\*大量平台事件使用個案需要附加元件](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_event_limits.htm)

\*\*\*適用於可在網頁瀏覽器中執行業務邏輯的情況。

資料欄圖例:

- **可用**:適用於大多數使用個案
- **非理想**:可能但請考慮替代工具
- **不可用**:未來十二個月內沒有支援的計畫

### 可能涉及將資料移入和移出 Salesforce 的其他工具:

其他工具可能支援資料層整合的某些層面,但不能視為解決整合問題的主要方法。現在讓我們快速查看這些工具。

**Lightning Web 元件**通常用於程序整合,但可以使用 JavaScript 功能進行呼叫,因此資料可能會涉及這些交易。

**Salesforce 流程**可用來使用「外部服務」或「Apex 動作」協調外部呼叫。Salesforce 流程本身並不視為獨立的資料整合工具。

**資料匯入精靈和 Data Loader** 可用來同步化、匯入和移轉資料。雖然 Data Loader 指令也可進行指令檔,以自動匯入和匯出資料,但 [指令行介面](https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/command_line_intro.htm)僅適用於 Windows,且這些工具都不為資料整合策略的建議基礎。請改用來補充您的資料管理與維護策略。

[**Salesforce CLI**](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_data.htm) 資料指令可用來操作您組織中的記錄。指令可協助您使用「大量 API」和「SObject 樹狀結構儲存 API」匯入和匯出資料,並透過 REST API 在個別記錄上執行簡單的 CRUD 作業。Salesforce CLI 本身並不視為獨立的資料整合工具。

**OmniStudio 資料對應工具**可作為陳述性 ETL 工具,在 Salesforce 物件與 JSON 資料結構之間移動資料。雖然會自動為每個「資料對應器」介面建立 REST 介面,提供從外部系統將資料移動至 Salesforce 物件的陳述性方式,但「資料對應器」獨立並非資料整合策略的建議基礎。「資料對應器」動作適用於 OmniStudio 整合程序。

[**Dataloader.io**](http://dataloader.io/) 是 Salesforce 的另一個資料載入工具,由 MuleSoft 的 Anypoint Platform 提供技術支援,可讓您快速安全地匯入、匯出和刪除企業的無限數量資料。Dataloader.io 並非資料整合策略的建議基礎。

## Salesforce 對外部系統 (輸出整合)

針對 Salesforce 的輸出整合,您可以考量不同類型的工具:低程式碼、專業程式碼或混合式。下列區段提供每個工具類型的指引,並提供範例解決方案。

- [輸出整合的低程式碼工具](#salesforce-中輸出整合的低程式碼工具)
- [輸出整合的混合式工具](#適用於-salesforce-輸出整合的混合式工具)
- [輸出整合的 Pro-Code 工具](#salesforce-中輸出整合的-pro-code-工具)

### Salesforce 中輸出整合的低程式碼工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th><strong>使用時機</strong></th>
            <th><strong>額外授權</strong></th>
            <th><strong>同步 (要求/回覆) 或非同步 (觸發/忘記)</strong></th>
            <th><strong>多物件支援</strong></th>
            <th><strong>LDV/大量</strong></th>
            <th><strong>測試與部署**</strong></th>
            <th><strong>除錯</strong></th>
            <th><strong>內建錯誤處理/重試行為</strong></th>
            <th><strong>可與靜態加密的資料搭配使用</strong></th>
            <th><strong>驗證通訊協定</strong></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>變更資料取</strong>取</td>
            <td>當您需要將在 Salesforce 中進行的記錄層級變更發佈至外部系統,且不需要自訂裝載時。</td>
            <td>必要</td>
            <td>非同步</td>
            <td>否</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>OAuth</td>
        </tr>
        <tr>
            <td><strong>外部服務</strong></td>
            <td>當您使用流程協調流程時,會使用 OpenAPI 規格描述 Apex、Einstein 機器人或 OmniStudio 和外部系統 API。</td>
            <td>不需要</td>
            <td>同步化</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td>無</td>
            <td>已命名認證</td>
        </tr>
        <tr>
            <td><strong>Heroku Connect</strong></td>
            <td>當您想要透過雙向同步擴充資料,以在 Heroku 上啟用行動應用程式和其他應用程式,且您想要將資料也複製到 Salesforce 時。</td>
            <td>必要</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td>使用 Pro Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是,透過 Shield Connect</td>
            <td>OAuth</td>
        </tr>
        <tr>
            <td><strong>OmniStudio 整合程序</strong></td>
            <td>當您需要在沒有使用者互動的情況下轉換資料,並透過在伺服器處理而非瀏覽器改善效能時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>宣告式支援</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>已命名認證</td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect/外部物件</strong></td>
            <td>當您想要資料顯示在 Salesforce UI 中,但想要資料儲存在外部系統中時。資料不會複製到 Salesforce。</td>
            <td>必要</td>
            <td>同步化</td>
            <td>否</td>
            <td class="guide-table-ok">是*</td>
            <td class="guide-table-ok">是</td>
            <td>具有 Pro-Code 工具和陳述性追蹤器</td>
            <td>否</td>
            <td>無</td>
            <td>已命名認證</td>
        </tr>
        <tr>
            <td colspan="11">*超過 4.01 版的 Odata 轉接器受限於呼叫限制。如需詳細資料,請參閱 <a href="https://help.salesforce.com/s/articleView?id=platform.odata_general_limits.htm&type=5">OData 呼叫率限制考量事項</a>。 ** 測試與部署是指在較低環境中建立並透過 <a href="https://developer.salesforce.com/docs/metadata-coverage/">中繼資料 API</a>、封裝或變更集部署至生產的能力。</td>
        </tr>
    </tbody>
</table>

### 使用個案:使用低程式碼工具的輸出整合

> 當機會成交時,必須在公司的 ERP 系統或訂單管理系統中建立相關產品的訂單。

當「機會」記錄更新時,「變更資料集合」會發佈包含物件更新的變更事件。\*\*\*\*變更事件會透過 CometD 連線 (或透過 MuleSoft 連接器) 客戶端耗用,並用於更新客戶的 ERP 或訂單管理系統。變更事件可以加強,以一律包含外部記錄識別碼或物件 (例如區域) 中整合所需的其他資料。可將多個物件的變更事件串流合併為簡化訂閱和串流處理的 _管道_ (因此您可以訂閱和處理一個串流,而非多個串流)。

**外部服務** 如果您的 Web 服務支援 OpenAPI 2.0 或 3.0 規格,您可以在 Salesforce 中將作業和服務公開為外部服務。當機會的階段變更為「成交」時,在使用 Flow Builder 建立的流程中,API 作業 (例如建立順序) 可以稱為可叫用動作。

**Heroku Connect** Heroku Connect 通常用於將 Heroku Postgres 資料庫與 Salesforce 保持同步。如果客戶使用 Heroku Postgres 作為其事實來源交易存放區,則您可以使用 Heroku Connect 將記錄和從 Salesforce 變更同步至 Heroku Postgres。從此處,您可以使用 Heroku 串流連接器將這些變更發佈至 Apache Kafka,並將其作為事件傳送至下游應用程式,包括 ERP 或訂單管理系統。

**OmniStudio 整合程序** 提交訂單時,協調流程的 Omniscript 可以將訂單詳細資料張貼到 ERP 或 MuleSoft 連接器。貼文可以直接由 Omniscript (用戶端) 或間接透過整合程序 (伺服器端) 執行。如果 ERP 系統引發驗證錯誤,Omniscript UI 必須通知使用者,並視需要為使用者翻譯並內容化錯誤。

**Salesforce Connect/外部物件** 您可以在 Salesforce 中建立記錄觸發流程,當機會的階段變更為「成交」時,將記錄插入相關外部物件。由於這是[混合交易](https://help.salesforce.com/articleView?id=000328873&type=1&mode=1),因此為了避免錯誤,請在「機會」更新與相關外部物件插入之間新增零秒的暫停元素,以便您在開始新的交易內容之前關閉一個交易內容。

### 適用於 Salesforce 輸出整合的混合式工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th><strong>使用時機</strong></th>
            <th><strong>額外授權</strong></th>
            <th><strong>同步 (要求/回覆) 或非同步 (觸發/忘記)</strong></th>
            <th><strong>多物件支援</strong></th>
            <th><strong>LDV/大量</strong></th>
            <th><strong>測試與部署**</strong></th>
            <th><strong>除錯</strong></th>
            <th><strong>內建錯誤處理/重試行為</strong></th>
            <th><strong>可與靜態加密的資料搭配使用</strong></th>
            <th><strong>驗證通訊協定</strong></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>Apex 動作</strong></td>
            <td>當您想要透過 Salesforce 流程將呼叫自動化至其他系統時。開發人員可以撰寫流程可叫用的 Apex 類別,或者您可以從 AppExchange 下載預先建立的解決方案。</td>
            <td>不需要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>事件轉送</strong></td>
            <td>當您需要從 Salesforce 將平台事件和變更資料擷取事件傳送至 Amazon EventBridge 時。事件轉送僅連線至 AWS Eventbridge</td>
            <td>否</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>具有 TLS 的 HTTP/1.1</td>
        </tr>
        <tr>
            <td><strong>輸出傳訊</strong></td>
            <td>當您需要透過 HTTP(S) 將 SOAP 訊息傳送至指定的端點,並在由工作流程規則觸發時保證收到。</td>
            <td>不需要</td>
            <td>非同步</td>
            <td>否</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>宣告式支援</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>雙向 TLS</td>
        </tr>
        <tr>
            <td><strong>平台事件</strong></td>
            <td>當您需要自定義的結構化裝載,以在 Salesforce 或外部系統中進行近乎即時的變更時。</td>
            <td>不需要*</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>OAuth</td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect/外部物件 (含自訂 Apex 轉接器)</strong></td>
            <td>當您想要資料顯示在 Salesforce UI 中,但想要資料儲存在無法使用如 Odata 或 GraphQL 等標準通訊協定的外部系統中時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td>無</td>
            <td>多</td>
        </tr>
         <tr>
            <td><strong>Data 360</strong></td>
            <td>當您想要在一個資料存放區中協調不同來源的資料,或想要將資料複製到其他 Salesforce 組織或其他外部系統時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>多</td>
        </tr>
    </tbody>
</table>

需要大量使用個案的 [\* 附加元件](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_event_limits.htm)。

\*\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力。

### 使用個案:使用混合式工具的輸出整合

> 當機會成交時,必須在公司的 ERP 或訂單管理系統中建立相關產品的訂單。

**Apex 動作** 根據機會狀態的記錄觸發流程可以在機會成交時自動觸發。流程會執行可叫用動作,使用外部呼叫將訂單提交至訂單管理系統或 ERP 解決方案。大量提交與多網站訂單是由 Apex 批次與排入排入機制處理。

**輸出傳訊** [設定輸出傳訊後](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_om_outboundmessaging_setting_up.htm),您可以定義由機會更新觸發的工作流程規則,以透過 HTTP(S) 將 SOAP 訊息傳送至主控接聽者的指定端點 URL。訊息將包含在建立輸出訊息時指定的欄位。若物件中的資訊在通知排入排隊後變更,但在通知傳送之前變更,則只會傳送更新的資訊,且訊息會保持在排隊中,直到通知成功傳送,或直到訊息已超過 24 小時為止。在 24 小時後,訊息便會遭到排除。如果 ERP 系統需要其他資料,您可以在輸出訊息中傳遞 sessionId,以便外部系統提出回呼要求。

**平台事件** 您可以定義平台事件,其中包含在外部系統中建立記錄所需的自訂裝載資料。由於「平台事件」不會在記錄變更時自動發佈,因此當機會的階段變更為「成交」時,您必須透過 Apex、Salesforce 流程或流程產生器發佈事件。外部服務會使用 CometD (或 MuleSoft 連接器) 聆聽平台事件管道,並在外部系統中建立適當的記錄。

**Salesforce Connect/外部物件 (含自訂 Apex 轉接器)** 以 Salesforce Connect/外部物件為基礎的解決方案不適合僅需要資料同步的使用個案。不過,此解決方案適用於 Salesforce 中的使用者需要查看,並可能與外部系統中的資料互動的個案,且資料無法在 Salesforce 中複製。如果 ERP 或訂單管理系統不支援 Odata 或 GraphQL 通訊協定,則開發小組可以使用 [Apex 連接器架構](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_start.htm)來撰寫處理透過支援通訊協定與外部系統通訊的 Apex 類別。

**Data 360** 以 Data 360 為基礎的解決方案非常適合我們在單一資料存放區中需要來自不同來源之協調資料的使用個案。當我們需要使用 Data 360 作為資料中心,將資料從一個 Salesforce 組織複製到多個 Salesforce 組織,或複製到其他外部系統時,也會使用此功能。當機會在來源組織中成交並更新時,機會資料會同步化至 Data 360,並可在其中使用動作、啟用和 API 等不同機制在其他系統中複製,包括 Salesforce 組織。同樣地,您可以參照機會,而無須使用 Data Cloud One 在其他 Salesforce 組織中複製資料。不過,Data Cloud One 不支援非 Salesforce 平台。

### Salesforce 中輸出整合的 Pro-Code 工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th><strong>使用時機</strong></th>
            <th><strong>額外授權</strong></th>
            <th><strong>同步 (要求/回覆) 或非同步 (觸發/忘記)</strong></th>
            <th><strong>多物件支援</strong></th>
            <th><strong>LDV/大量</strong></th>
            <th><strong>測試與部署**</strong></th>
            <th><strong>除錯</strong></th>
            <th><strong>內建錯誤處理/重試行為</strong></th>
            <th><strong>可與靜態加密的資料搭配使用</strong></th>
            <th><strong>驗證通訊協定</strong></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>自訂 Apex</strong></td>
            <td>當您需要的功能比低程式碼工具所提供的功能多。</td>
            <td>不需要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是*</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>外部服務</strong></td>
            <td>使用 OpenAPI 規格說明從程式碼與外部系統 API 整合。</td>
            <td>不需要</td>
            <td>同步化</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td>無</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>MuleSoft Anypoint</strong></td>
            <td>當您需要單一企業級統一解決方案來建立、協調和管理整合時;當您需要取代舊版點對點結構時;或當您需要 API 管理支援時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是*</td>
            <td>多</td>
        </tr>
    </tbody>
</table>

\*啟用 Shield Platform Encryption 會變更某些行為,請參閱 [一般 Shield Platform Encryption 考量事項](https://help.salesforce.com/articleView?id=sf.security_pe_considerations_general.htm&type=5)以取得詳細資料。

\*\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力。

### 使用個案:使用 Pro-Code 工具的輸出整合

> 當機會成交時,必須在公司的 ERP 或訂單管理系統中建立相關產品的訂單。

**自訂 Apex** 您可以在機會上建立 Apex 觸發和觸發處理常式,當機會的階段變更為「成交」時,其會對 ERP 或訂單管理系統進行呼叫。請注意,如果您從觸發或執行 DML 作業後進行呼叫,則必須使用註解為 future 或 queueable 的方法。觸發中的呼叫會在呼叫的留存時間內將資料庫連線保持開啟。所有 Apex 程式碼皆受限於「[Apex 管理員」和「API 限制](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_overview.htm)」,這些限制會持續修訂。

**外部服務** 如果透過 OpenAPI 規格定義公司的外部 ERP 或訂單管理系統,則可簡化對未來方法或可排列工作中執行之服務的呼叫。您可以直接從 Apex 呼叫註冊的外部服務,而無須撰寫板碼。在此範例中,可由外部服務處理建立訂單的呼叫。

**MuleSoft Anypoint** MuleSoft Anypoint 提供企業級 API 管理。MuleSoft Anypoint 可以建立 API 來啟用 Salesforce 和許多其他企業系統資料的讀取 (和/或寫入) 存取權。有 [許多預先建置的連接器可用](https://www.mulesoft.com/platform/cloud-connectors)來簡化實作,公司也可以建立和發佈自己的連接器。這些 API 可使用彈性的安全性原則在 Anypoint 中部署,並支援集中管理與管治。交易量沒有任何限制,只要 API 已適當調整其最大利用率的大小 (以 vCores 測量)。

## 將外部系統資料新增至 Salesforce (輸入整合)

針對 Salesforce 的輸入整合,您可以考量不同類型的工具:低程式碼、專業程式碼或混合式。下列區段提供每個工具類型的指引,並提供範例解決方案。

- [輸入整合的低程式碼工具](#輸入整合至-salesforce-的低程式碼工具)
- [輸入整合的混合式工具](#適用於-salesforce-輸入整合的混合式工具)
- [輸入整合的 Pro-Code 工具](#輸入整合至-salesforce-的-pro-code-工具)

### 輸入整合至 Salesforce 的低程式碼工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th>使用時機</th>
            <th>其他授權</th>
            <th>同步 (要求/回覆) 或非同步 (觸發/忘記)</th>
            <th>多物件支援</th>
            <th>LDV/Bulk</th>
            <th>測試與部署*</th>
            <th>除錯</th>
            <th>內建錯誤處理/重複處理行為</th>
            <th>可與靜態加密的資料搭配使用</th>
            <th>驗證通訊協定</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>Heroku Connect</strong></td>
            <td>當您想要透過雙向同步擴充資料,以在 Heroku 上啟用行動應用程式和其他應用程式,且您想要將資料也複製到 Salesforce 時。</td>
            <td>必要</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是,透過 Shield Connect</td>
            <td>OAuth</td>
        </tr>
        <tr>
            <td><strong>OmniStudio 整合程序</strong></td>
            <td>當您需要在沒有使用者互動的情況下,從第三方來源匯入和轉換資料時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>宣告式支援</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>已命名認證</td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect/外部物件</strong></td>
            <td>當您想要資料顯示在 Salesforce UI 中,但想要資料儲存在可使用標準通訊協定 (例如 Odata 或 GraphQL) 的外部系統中時。</td>
            <td>必要</td>
            <td>同步化</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td>無</td>
            <td>多</td>
        </tr>
    </tbody>
</table>

\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力。

### 使用個案:使用低程式碼工具進行輸入整合

> 連絡人會在組織的 ERP 系統中更新。此連絡人資訊必須在 Salesforce 中更新。

**Heroku Connect** Heroku Connect 通常用於將 Heroku Postgres 資料庫與 Salesforce 保持同步。除非 ERP 系統使用 Heroku Postgres 作為其交易存放區,否則此使用個案無法使用。如果使用 Heroku Postgres,則在 Postgres 表格中進行的變更可以使用 Heroku Connect 同步化至 Salesforce 中的物件。

**OmniStudio 整合程序** ERP 系統更新連絡人記錄後,可透過資料對應器產生的 REST API 呼叫包含資料對應器載入動作和回應動作的 OmniStudio 整合程序。首先,資料對應器載入動作會傳送 JSON 或 XML 裝載,用於根據「外部識別碼」欄位或透過「[更新插入金鑰」](https://trailhead.salesforce.com/content/learn/modules/omnistudio-data-tools-and-internal-data/build-an-integration-procedure-with-conditional-dataraptor-loads?trail_id=build-guided-experiences-with-omnistudio)更新插入連絡人記錄。如果 JSON 中的簡單回應僅限預期,則「回應動作」會傳回先前動作中的任何相關資訊,以表示成功或失敗。如果 ERP 系統預期特定回應,則可使用「資料對應器轉換」或「解壓縮動作」產生含額外功能的 JSON 或 XML 回應,以宣告方式包含連絡人記錄更新所產生觸發中的資料。此案例的主要挑戰是並行:多個呼叫同時更新相同的連絡人記錄會造成問題,因為 API 存在於 Salesforce 中。

不建議針對此使用個案使用 **Salesforce Connect/外部物件** Salesforce Connect 和外部物件,因為此情況特別需要在 Salesforce 中複製資料。如果您擁有建立於 ERP 的預先存在 Salesforce Connect 整合,則如果 ERP 支援變更資料資料擷取,您可以設定 Odata 4.0 連接器來支援外部變更資料擷取。此外,您必須在 Salesforce 中設定,以使用 Pub/Sub API 從 ERP 訂閱變更串流。

### 適用於 Salesforce 輸入整合的混合式工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th>使用時機</th>
            <th>其他授權</th>
            <th>同步 (要求/回覆) 或非同步 (觸發/忘記)</th>
            <th>多物件支援</th>
            <th>LDV/Bulk</th>
            <th>測試與部署**</th>
            <th>除錯</th>
            <th>內建錯誤處理/重複處理行為</th>
            <th>可與靜態加密的資料搭配使用</th>
            <th>驗證通訊協定</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>平台事件</strong></td>
            <td>當您需要自定義的結構化裝載,以在 Salesforce 或外部系統中進行近乎即時的變更時。</td>
            <td>不需要*</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>OAuth</td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect/外部物件 (含自訂 Apex 轉接器)</strong></td>
            <td>當您需要資料顯示在 Salesforce UI 中,但想要資料儲存在無法使用 Odata 2.0/4.0 通訊協定的外部系統中時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td>無</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>Data 360</strong></td>
            <td>當您想要在一個資料存放區中協調不同來源的資料,或想要將資料從其他 Salesforce 組織或複製到其他外部系統時。Data 360 也支援某些平台的虛擬化。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>多</td>
        </tr>
    </tbody>
</table>

\* 大量使用個案需要[附加元件](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_event_limits.htm)。

\*\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力。

### 使用個案:使用混合式工具進行輸入整合

> 連絡人會在組織的 ERP 系統中更新。此連絡人資訊必須在 Salesforce 中更新。

外部系統中的「**平台事件」**自訂程式碼會在 ERP 中更新連絡人記錄時發佈「平台事件」。Salesforce 中的觸發、程序或流程可以訂閱平台事件,並在處理事件時更新對應的 Salesforce 物件。平台事件可能只會作為在客戶 ERP 系統中發生變更而不包含任何資料的訊號運作,或者可能包含更新 Salesforce 物件所需的實際資料。

**Salesforce Connect/外部物件 (含自訂 Apex 轉接器)** 此解決方案不適用於需要資料複製的使用個案。如果您需要 Salesforce 中的使用者查看來自外部系統的資訊,且外部系統不支援如 Odata 或 GraphQL 等標準通訊協定,則此解決方案適用。請參閱 [使用個案:輸出整合使用混合式工具](#使用個案使用混合式工具的輸出整合)作為 Apex 自訂轉接器的範例使用個案。

**Data 360** 當在外部系統 (例如 ERP) 中更新連絡人時,可使用立即可用的連接器,或使用 API 和 Pro-Code 工具 (例如 MuleSoft) 將連絡人更新同步至 Data 360。您也可以使用零複製機制在 Data 360 中參照連絡人 (適用於某些平台)。一旦資料可在 Data 360 中使用,即可使用不同的立即可用整合機制將資料同步至其他 Salesforce 組織。您可以使用 Data Cloud One 透過參照來存取資料。您也可以使用立即可用的連接器來複製資料,或透過如 MuleSoft Anypoint 平台等專業程式碼工具的協助來複製資料。

### 輸入整合至 Salesforce 的 Pro-Code 工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>授權</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
        </tr>
        <tr>
            <th></th>
            <th>使用時機</th>
            <th>其他授權</th>
            <th>同步 (要求/回覆) 或非同步 (觸發/忘記)</th>
            <th>多物件支援</th>
            <th>LDV/Bulk</th>
            <th>測試與部署****</th>
            <th>除錯</th>
            <th>內建錯誤處理/重複處理行為</th>
            <th>可與靜態加密的資料搭配使用</th>
            <th>驗證通訊協定</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>自訂 Apex REST 與 SOAP Web 服務</strong></td>
            <td>當您需要比原生 API 端點提供更多的功能時,例如跨物件處理或其他複雜邏輯。</td>
            <td>不需要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是***</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>MuleSoft Anypoint</strong></td>
            <td>當您需要單一企業級統一解決方案來建立、協調和管理整合時;當您需要取代舊版點對點結構時;或當您需要 API 管理支援時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是***</td>
            <td>多</td>
        </tr>
        <tr>
            <td><strong>原生 Salesforce API</strong></td>
            <td>當您需要更多控制或擁有專業程式碼技能集,以透過 REST API、SOAP API、大量 API 或 GraphQL API 或 gRPC 建立整合時。</td>
            <td>不需要*</td>
            <td>兩者</td>
            <td class="guide-table-ok">是*****</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是**</td>
            <td class="guide-table-ok">是***</td>
            <td>多</td>
        </tr>
    </tbody>
</table>

\* 適用「[API 要求上限與配置](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm)」。

\*\*大量 API 有重試行為的層面,而一些 API 透過 allOrNone 設定提供*回復*保護 (例如,請參閱複合與集合要求中的 [allOrNone 參數](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_allornone.htm))

\*\*\*啟用 Shield Platform Encryption 會變更某些行為,請參閱 [一般 Shield Platform Encryption 考量事項](https://help.salesforce.com/articleView?id=sf.security_pe_considerations_general.htm&type=5)以取得詳細資料。

\*\*\*\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力。

\*\*\*\*\*複合 API 有多物件支援。

### 使用個案:使用 Pro-Code 工具進行輸入整合

> 連絡人會在組織的 ERP 系統中更新。此連絡人資訊必須在 Salesforce 中更新。

**自訂 Apex REST 和 SOAP Web 服務** 您可以使用可在「連絡人」物件上執行 CRUD (建立、讀取、更新、刪除) 作業的 Apex 程式碼建立 Web 服務。此服務會透過 SOAP 或 REST 從外部系統 (ERP) 叫用。

**MuleSoft Anypoint** MuleSoft Anypoint 的意圖是提供企業級 API 管理。MuleSoft Anypoint 提供一[組大型預先建置連接器](https://www.mulesoft.com/platform/cloud-connectors),可用來與許多 ERP 系統整合,包括 SAP、Oracle EBS、Oracle ERP 和 NetSuite。您可以建立流程來聆聽這些 ERP 系統中的事件 (在此個案中為建立新連絡人時)。流程開始時,會使用 Salesforce 連接器建立新的「連絡人」記錄 (若連絡人已存在則更新一個)。此外,如果複製交易涉及將連絡人新聞訂閱至其他系統,則可以與其他系統整合。您可以視需要使用對應和轉換語言 (DataWeave) 來執行複雜邏輯和計算,作為跨多個不同系統的資訊流程。針對這些系統的驗證可透過許多不同的驗證機制完成,例如基本驗證和 OAuth。只要流程已適當調整其最大利用率的大小 (以 vCores 測量),交易量就沒有任何限制。

當 ERP 系統中的更新交易完成 (或立即完成後),您可以透過 SOAP API 對「連絡人」物件執行更新插入作業,或對 Salesforce 組織中的 Contact sObjects REST API 執行 [PATCH](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm) 。\*\*\*\*

## Salesforce 到 Salesforce 整合

Salesforce 到 Salesforce 產品已到期。Salesforce 到 Salesforce 讓合作夥伴可以輕鬆地共同銷售並支援聯合客戶,但 Salesforce 將投資在為其他工具帶來更多創新。繼續進行時,建議使用下列方法在 Salesforce 組織之間共用資料。

### 在整個 Salesforce 組織之間資料整合的工具

<table>
    <thead>
        <tr>
            <th></th>
            <th>指引</th>
            <th>成本</th>
            <th>時間</th>
            <th>體積與規模</th>
            <th></th>
            <th></th>
            <th>交付與維護</th>
            <th></th>
            <th>隱私權與安全性</th>
            <th></th>
            <th>要實作的工具</th>
        </tr>
        <tr>
            <th></th>
            <th><strong>使用時機</strong></th>
            <th><strong>額外授權</strong></th>
            <th><strong>同步 (要求/回覆) 或非同步 (觸發/忘記)</strong></th>
            <th><strong>多物件支援</strong></th>
            <th><strong>LDV/大量</strong></th>
            <th><strong>測試與部署*</strong></th>
            <th><strong>除錯</strong></th>
            <th><strong>內建錯誤處理/重試行為</strong></th>
            <th><strong>可與靜態加密的資料搭配使用</strong></th>
            <th><strong>驗證通訊協定</strong></th>
            <th><strong>低程式碼 → 專業代碼</strong></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong>Heroku Connect</strong></td>
            <td>當您想要透過跨 Salesforce 組織的雙向同步擴充資料,同時啟用從 Heroku 上執行的行動應用程式和其他應用程式存取資料時</td>
            <td>必要</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>否</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是,透過 Shield Connect</td>
            <td>OAuth</td>
            <td>低程式碼</td>
        </tr>
        <tr>
            <td><strong>MuleSoft Anypoint</strong></td>
            <td>當您需要單一企業級統一解決方案來建立、協調和管理整合時;當您需要取代舊版點對點結構時;或當您需要 API 管理支援時</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是**</td>
            <td>多</td>
            <td>專業代碼</td>
        </tr>
        <tr>
            <td><strong>原生 Salesforce API</strong></td>
            <td>當 Salesforce 或 Heroku Connect 不是選項或您需要更複雜的處理時</td>
            <td>不需要</td>
            <td>兩者</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>否</td>
            <td class="guide-table-ok">是**</td>
            <td>多</td>
            <td>專業代碼</td>
        </tr>
        <tr>
            <td><strong>變更資料取</strong>取</td>
            <td>當您需要將在 Salesforce 中進行的記錄層級變更發佈至外部系統,且不需要自訂裝載時。</td>
            <td>必要</td>
            <td>非同步</td>
            <td>否</td>
            <td>否</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>OAuth</td>
            <td></td>
        </tr>
        <tr>
            <td><strong>Salesforce Connect 與跨組織轉接器</strong></td>
            <td>當您想要一個組織中的使用者檢視或編輯不同組織的記錄時,無須複製資料</td>
            <td>必要</td>
            <td>非同步</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td>無</td>
            <td>無</td>
            <td>多</td>
            <td>低程式碼</td>
        </tr>
        <tr>
            <td><strong>Data 360</strong></td>
            <td>當您想讓一個組織中的使用者檢視或編輯不同組織中具有 Data 360 中所複製資料的記錄時。</td>
            <td>必要</td>
            <td>兩者</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>使用 Pro-Code 工具</td>
            <td class="guide-table-ok">是</td>
            <td class="guide-table-ok">是</td>
            <td>多</td>
            <td>混合式</td>
        </tr>
    </tbody>
</table>

\*測試與部署是指在較低環境中建立並透過 [中繼資料 API](https://developer.salesforce.com/docs/metadata-coverage/)、封裝或變更集部署至生產的能力

\*\*啟用 Shield Platform Encryption 會變更某些行為,請參閱 [一般 Shield Platform Encryption 考量事項](https://help.salesforce.com/articleView?id=sf.security_pe_considerations_general.htm&type=5)以取得詳細資料。

_平台事件不適合將一個 Salesforce 組織的資料整合到另一個組織,因為它們無法在同一個事件的組織之間「聆聽」。自訂 Apex 也不為此類型整合的建議方法。_

### 使用個案:連線多個 Salesforce 組織

> 大型企業在多個業務單位 (BU) 之間營運。每個 BU 都有自己的 Salesforce 組織。單一客戶處理企業的多個業務單位,因此在多個組織中擁有帳戶和機會資料。企業需要存取單一組織中所有 BU 之間所有「帳戶」和「機會」資料的彙總檢視。

_注意:根據「[Takeaway #1](#接待時間)」,下列所有解決方案都針對最少數量的資料複製設計。_

您可以使用立即可用的 Salesforce 連接器,將不同 Salesforce 組織的「**Data 360 帳戶」**和機會資料提取至 Data 360。也可以彙總和協調 (若有需要)。在 Data 360 中彙總資料後,即可使用 Data Cloud One 在其他 Salesforce 組織中存取資料,而無須資料複製。

**Heroku Connect** 針對每個 BU 的個別組織,您可以使用 Heroku Connect 將變更從 Salesforce 同步至單一 Heroku Postgres 資料庫。在此情節下,雙向同步化未啟用,只會從 Salesforce 同步化至 Postgres。接著,在 Heroku Connect 中,您可以啟用 Odata 提供者,並選取要在 Salesforce 組織中公開為外部物件的表格,其中您想要彙總檢視。在 Salesforce 中,您可以定義指向 Heroku 中 Odata 提供者的外部資料來源。

**MuleSoft Anypoint** MuleSoft Anypoint 提供企業級 API 管理。MuleSoft Anypoint API 可以設定為使用具有組織多個連線的 Salesforce 連接器來讀取來自多個相關 Salesforce 組織的資訊。MuleSoft 流程可查詢不同的 Salesforce 組織,並視需要傳回增強或增強其他第三方資訊的特定結構。叫用 API 時,會執行所有適當的 Salesforce 組織呼叫 (在此範例中查詢帳戶和機會資訊),以便取用者 (可能為 UI) 可以處理資料。對這些系統的驗證可以透過各種驗證機制完成,包括基本驗證和 OAuth。交易量沒有任何限制,只要流程已適當調整其最大利用率的大小 (以 vCores 或 Core 測量)。

「**原生 Salesforce API」** 查詢作業可以發出給每個感興趣的組織,特別是透過 Salesforce 大量 API 2.0,該 API 非常適合有效地提取數千筆記錄。您可以個別從每個組織中提取查詢結果,並根據客戶需求將其與自訂應用程式或中間程式彙總。

**Salesforce Connect with Cross-Org Adapter** Salesforce Connect Cross-Org 轉接器不適合此情況,因為遠端組織的帳戶或機會將全部顯示在中央組織中,作為 *不同的*物件。例如,無法為所有組織中所有機會的「金額」加總總計。

**選擇性更新跨組織案例:**銷售人員使用 Salesforce 組織 A,需要檢視和更新 Salesforce 組織 B 中的「個案」資料,並在組織 A 中工作時,將個案註解新增至 Salesforce 組織 B 上的父系個案。資料不能複製到組織 A。

**Heroku Connect** 您可以使用上述 *資料彙總案例*中所述的相同方法。不過,您必須透過 Odata 連接器在外部物件上啟用 CRUD,並將變更寫回 Heroku Postgres。

**MuleSoft Anypoint** MuleSoft Anypoint 提供企業級 API 管理。您可以使用上述 *資料彙總情境*中所述的相同方法。

**原生 Salesforce API** 使用已命名認證並叫用原生 Salesforce API 以讀取和更新相關 Salesforce 組織中的資料。元件必須設計為顯示資料。

**Salesforce Connect with Cross-Org Adapter** 透過 [Salesforce 跨組織轉接器](https://help.salesforce.com/articleView?id=sf.xorg_adapter_about.htm&type=5)支援檢視外部物件中的資料 (如果您已在外部物件上啟用 CRUD,則也可以編輯資料)。外部物件之間也支援關係,因此您可以連結至外部物件中的父系個案。然而,建立關係是手動流程,您現在可以將現有資料類型轉換為關係資料類型。此外,在 Service Cloud 中執行的最佳化以更有效率地使用「個案」不會串聯至遠端組織。Salesforce 強烈建議您針對使用個案測試「跨組織轉接器」,並評估使用「外部物件」與「標準物件」的權衡。

**資料同步跨組織**:當組織其中一個業務單位 Salesforce 組織中更新客戶的帳戶時,其他 Salesforce 組織的「帳戶」物件必須更新,才能保持一致的帳戶資訊。

**Data 360** Data 360 可用於從一個組織複製資料至另一個 Salesforce 組織。單一 Salesforce 組織的帳戶資料可使用立即可用的 Salesforce 連接器,以便將這些連接中所輸入的資料匯入至 Data 360。我們也可以使用資料啟用機制,例如批次啟用、近乎即時的資料動作或以 API 為基礎的啟用,將資料從 Data 360 移至 Salesforce 組織。

**Heroku Connect** 您可以使用上述 *資料彙總案例*中所述的相同方法。不過,您必須啟用雙向同步化,且您不再需要啟用 Salesforce Connect,因為雙向同步化會在對 Postgres 表格進行變更時讓所有組織保持在最新狀態。

**MuleSoft Anypoint** MuleSoft Anypoint 提供企業級 API 管理。您可以在 MuleSoft Anypoint 中使用 Flow Designer [設定 Mule 應用程式](https://docs.mulesoft.com/design-center/about-designing-a-mule-application),以聆聽標準和自訂物件事件,以在 Salesforce 中開始自動啟動流程。觸發 Mule 應用程式時,其可以叫用 Anypoint Connector for Salesforce 以與任何數量的 Salesforce 組織通訊。在此使用個案中,當 Salesforce 組織中更新「帳戶」記錄時,Mule 應用程式可以更新相關 Salesforce 組織中的「帳戶」記錄。每個相關的 Salesforce 組織都會擁有內建在 MuleSoft 中整體應用程式流程中的唯一更新步驟。對這些系統的驗證可以透過各種驗證機制完成,包括基本驗證和 OAuth。只要流程已適當調整其最大利用率的大小 (以 vCores 或 Core 測量),交易量就沒有任何限制。

**原生 Salesforce API** [Replication API](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_guidelines_datareplication.htm) (getUpdated、getDeleted 作業) 可用來跨組織同步化資料,但不建議使用此方法。

**Salesforce Connect with Cross-Org Adapter** 您可以使用記錄觸發流程和外部物件,讓 Salesforce 組織之間的部分資料保持同步。例如,更新「組織 A」中的帳戶記錄會觸發流程,然後更新「帳戶」外部物件上的相符記錄,這會將這些更新寫入「組織 B」中的帳戶記錄。這需要正確使用流程語意,以避免進行[混合的 DML 交易](https://help.salesforce.com/articleView?id=000328873&type=1&mode=1)。此外,請記住,「組織 B 中的驗證規則和流程」會以與 REST/SOAP API 進行變更時相同的方式觸發。

## 結束備註

請記住此指南,並在您規劃涉及 Salesforce 的新資料整合時參閱該指南。最好瞭解您可用的完整選項範圍,以及這些選項如何符合您的特定使用個案。

### 告訴我們您的想法

協助我們確保我們發佈與您最相關的內容。[參加我們的調查](https://sfdc.co/J0cWb)以提供此內容的回饋意見,並告訴我們您接下來想要查看的內容。
