Skip to content

§00Integrations / CRM

Salesforce integration: Closed Won is where the integration starts.

Salesforce is where deals are won; the ERP is where they become customers, orders, shipments and invoices. PartnerMCP starts on IsWon through Change Data Capture, builds the order from the OpportunityLineItems rather than the Amount, and writes delivery and invoice status back with upserts by external ID, so a retry never creates a second record.

How PartnerMCP connects

01Primary path

Change Data Capture over the Pub/Sub API

OpportunityChangeEvent and other change events arrive over gRPC with Avro payloads. Salesforce keeps them for 72 hours and replays from a stored Replay ID, so PartnerMCP resumes where it stopped after a restart. The Pub/Sub API isn't available in Government Cloud.

Product
Salesforce
Vendor
Salesforce
Category
CRM
Runs
Cloud
Connects through
REST + Pub/Sub API
Detects changes with
Change Data Capture (Pub/Sub API)
Product
Salesforce Service Cloud
Vendor
Salesforce
Category
Support
Runs
Cloud
Connects through
REST + Pub/Sub API
Detects changes with
Change Data Capture (CaseChangeEvent)
On this page
  1. 01What you can build
  2. 02Objects and events
  3. 03What it handles
  4. 04Pairings
  5. 05Questions
  6. 06References
§01—What you can build

What you can build.

Each one starts as a sentence. PartnerMCP answers with a plan in Salesforce’s own objects, then builds it against your systems.

01Opportunity → ERP sales order

“When an Opportunity becomes Closed Won, create or update the customer in Priority, create the sales order, synchronize the products and pricing, and send the fulfillment and invoice status back to Salesforce.”

Build this integration

PartnerMCP will

  1. Subscribe to OpportunityChangeEvent and act when IsWon becomes true.
  2. Match or create the ERP customer from the Account, and keep the ERP customer number in an External ID field.
  3. Build the order from OpportunityLineItems — ProductCode, Quantity, UnitPrice and Discount — never from Amount.
  4. Compare the ERP's computed total with Opportunity.Amount and flag differences.
  5. Write the order number, delivery and invoice status back with upsert by external ID.

02Salesforce ↔ SAP S/4HANA

“Synchronize accounts, quotations, sales orders, invoices and fulfillment between Salesforce and SAP S/4HANA.”

Build this integration

PartnerMCP will

  1. Map Accounts to SAP business partners through API_BUSINESS_PARTNER.
  2. Check pricing and availability with API_SALES_ORDER_SIMULATION_SRV before an order is created.
  3. Create A_SalesOrder with its A_SalesOrderItem lines when the Opportunity is won.
  4. Follow outbound deliveries and billing documents, and show their status on the Opportunity.

03Salesforce → NetSuite

“When an Opportunity closes, create the customer and sales order in NetSuite and show fulfillment and invoice status on the Opportunity.”

Build this integration

PartnerMCP will

  1. Look up the NetSuite customer by its external ID before creating one.
  2. Create the salesorder through SuiteTalk REST, inside PartnerMCP's share of the account's concurrency.
  3. Read itemfulfillment and invoice changes with SuiteQL on lastmodifieddate.
  4. Write the status back to the Opportunity with upsert by external ID.

04ERP account health on the Account

“Show each Account's open invoices from the ERP, and warn the owner in Slack before a deal closes for a customer with overdue invoices.”

Build this integration

PartnerMCP will

  1. Read open invoices and balances from the ERP on a schedule.
  2. Write them to Account fields that PartnerMCP owns, and nothing else.
  3. When an Opportunity on that Account reaches its last open stage, notify the owner in Slack with the overdue amount.
§02—Objects and events

Objects and events, by their API names.

The records PartnerMCP reads and writes in Salesforce, and the events that start a run.

  • Opportunity

    Opportunity

    StageName drives IsWon and IsClosed, which are read-only. With products, Amount is the sum of the line items and direct updates to it are ignored. CloseDate is required; CurrencyIsoCode in multi-currency orgs.

  • Opportunity products

    OpportunityLineItem

    PricebookEntryId (required), Quantity, UnitPrice or TotalPrice (not both) and Discount. ProductCode is read-only, from Product2.

  • Account

    Account

    Name is required. BillingCountryCode (ISO) when State and Country/Territory picklists are on; otherwise BillingCountry, free text up to 80 characters.

  • Product

    Product2

    ProductCode, StockKeepingUnit, ExternalId, IsActive, QuantityUnitOfMeasure and Family.

  • Price book entry

    PricebookEntry

    One per product, price book and currency. The standard price must exist before custom price books; Pricebook2Id and Product2Id can't change after create.

  • Order

    OrderOrderItem

    Status maps to StatusCode Draft, Activated or Superseded, and AccountId can change only while Draft. Each OrderItem needs a PricebookEntryId.

  • Case

    Case

    Service Cloud. Closed state comes from Status, never IsClosed. SuppliedEmail is required on API-created cases when an auto-response rule is active.

Events

  • Change Data Capture

    Change events for Opportunity, OpportunityLineItem, Order, OrderItem, Account, Contact, Case, Product2, PricebookEntry, Quote and every custom object. Each header carries changeType, changedFields and changeOrigin; events are kept 72 hours and PartnerMCP de-duplicates on the event id.

  • Platform Events

    Custom events your org already publishes from Apex, Flow or the Pub/Sub API, for business moments you model yourself.

  • Polling on SystemModstamp

    SOQL on SystemModstamp — or getUpdated() — for objects without change events and for scheduled reconciliation.

  • Outbound Messages — not relied on

    Retried for up to 24 hours, they can arrive twice or out of order, and Salesforce says they can't be used as an audit trail. PartnerMCP doesn't build on them.

§03—What it handles

What PartnerMCP handles for you.

The details that break Salesforce integrations in production, and what PartnerMCP does about each one.

  1. 01

    Closed Won is IsWon, not a label

    Stage names are org-specific; IsWon follows the stage's mapping. PartnerMCP triggers on IsWon, so renaming a stage never breaks the integration.

  2. 02

    Amount is a cross-check, not an input

    When an Opportunity has products, Amount is the sum of its line items and updates to it are silently ignored. PartnerMCP builds orders from OpportunityLineItems and compares the ERP's total with Amount afterwards.

  3. 03

    Change Data Capture allocations

    By default only 5 entities can be selected for change events, and Enterprise Edition delivers 25,000 events per 24 hours, shared by every subscriber. PartnerMCP subscribes only to what its flows need and reconciles the rest by polling.

  4. 04

    No echo loops

    PartnerMCP's own writes carry Sforce-Call-Options with its client ID, and it filters change events by changeOrigin, so a status it writes never triggers the flow again.

  5. 05

    Upserts that refuse to guess

    An upsert that matches several records returns 300 and writes nothing. PartnerMCP turns that into a review item instead of picking one.

  6. 06

    Org-wide API limits

    Enterprise orgs get 100,000 requests per rolling 24 hours plus 1,000 per licence, and at most 25 long-running requests at once. PartnerMCP batches with Composite and sObject Collections and watches the Sforce-Limit-Info header.

  7. 07

    What change events miss

    Change Data Capture doesn't fire for hard deletes, and events over 1 MB become gap events. PartnerMCP re-reads the records after a gap event and reconciles on a schedule.

  8. 08

    Price books before line items

    Line items need a price book, the first one sets the Opportunity's Pricebook2Id, and a custom price book entry needs a standard price first. PartnerMCP checks PricebookEntry coverage before it syncs ERP prices.

§04—Pairings

Pairings, step by step.

Each pair page has the plan, the field mapping and the edge cases for that combination.

§05—Questions

Salesforce integration questions.

What does PartnerMCP need in Salesforce?

An External Client App for OAuth (JWT bearer or client credentials), an integration user that can read and write the objects in the flow, and Change Data Capture selected for the objects that start a run.

Does it use Salesforce's hosted MCP servers?

Where you've enabled them. They act as the signed-in user with field-level security and sharing, and Salesforce notes they're intended for customers with Flex Credits and may be billed. Production flows use the REST and Pub/Sub APIs either way.

What happens if the integration is offline for a few hours?

Change events are kept for 72 hours. PartnerMCP stores the last Replay ID it processed and resumes from there; anything older is reconciled by SystemModstamp.

How are multi-currency orgs handled?

PartnerMCP reads CurrencyIsoCode from the Opportunity, uses the PricebookEntry for that currency, and maps it to the ERP order's currency.

Will it overwrite what sales reps type?

No. Each flow writes only the fields it owns — order number, delivery and invoice status, for example — and leaves every other field alone.

§06—References

Vendor documentation.

The public documentation behind the technical details on this page.

§07Next step

Connect Salesforce to the rest of your systems.

Describe what should happen. PartnerMCP shows you the plan before anything is built.