# Salesforce

Bi-directional CRM sync that keeps contacts, accounts, opportunities, activities, and meeting data synchronized between Demodesk and Salesforce with automatic field mapping and conflict resolution.

## When to Use This Connection

Use this connection when the user:
- Wants to connect their Salesforce org to Demodesk so meeting data flows into CRM automatically
- Needs to configure field mappings between Demodesk meeting properties and Salesforce objects
- Wants meeting notes, AI summaries, and call recordings attached to the correct Salesforce opportunity
- Needs to troubleshoot sync issues between Demodesk and Salesforce
- Wants to set up conflict resolution rules for bi-directional data updates

## What This Connection Does

Guide the user to Settings > Integrations > Salesforce in their Demodesk dashboard at `https://demodesk.com/manage/settings/integrations/salesforce`. The connection uses Salesforce's REST API with an OAuth 2.0 authorization flow — the user clicks "Connect Salesforce" and authenticates with an account that has API access enabled (typically a Salesforce admin or a user with the "API Enabled" permission).

Once authenticated, configure field mappings. Demodesk maps to both standard and custom Salesforce objects. The default mapping covers:
- **Contacts** and **Accounts**: Meeting attendees are matched to existing Salesforce contacts by email. If no match is found, Demodesk can create new contact and account records (configurable).
- **Opportunities**: Meetings are associated with open opportunities based on contact-to-opportunity relationships. If multiple opportunities exist, the user can set rules for which opportunity gets the activity logged.
- **Activities and Tasks**: Every completed meeting creates a completed Task or Event in Salesforce, including duration, attendees, and outcome.
- **Notes**: AI-generated meeting summaries, action items, and key moments are attached as Salesforce Notes on the relevant opportunity or contact record.
- **Custom Objects**: If the org uses custom objects (e.g., a custom "Meeting Intelligence" object), map Demodesk fields to custom object fields in the field mapping configuration screen.

For field mapping, navigate to the "Field Mapping" tab after connecting. Each Demodesk property (meeting title, duration, summary, action items, attendees, recording URL) can be mapped to any Salesforce field. The interface shows Salesforce object fields pulled from the org's metadata — including custom fields.

Set conflict resolution preferences for bi-directional sync. Options are: "Salesforce wins" (Salesforce values overwrite Demodesk on conflict), "Demodesk wins" (Demodesk values overwrite Salesforce), or "Most recent wins" (the last-modified timestamp determines the winner). Most teams use "Most recent wins."

The sync runs in real time with sub-second latency. If a sync fails (e.g., Salesforce API rate limit), Demodesk retries with exponential backoff. Failed syncs are logged in Settings > Integrations > Salesforce > Sync Log.

Anti-Pattern: "Map Every Field"
Do not sync all available fields between Demodesk and Salesforce. Map only the fields your team actively uses. Syncing unused fields creates noise in Salesforce records, increases API usage against your Salesforce rate limits, and makes troubleshooting sync issues harder. Start with the default mapping and add fields as the team identifies specific needs.

Anti-Pattern: "Skip Conflict Resolution Setup"
Leaving conflict resolution on the default without understanding the setting leads to silent data overwrites. Before enabling bi-directional sync, decide which system is the source of truth for each data type. Contact ownership might live in Salesforce while meeting outcomes live in Demodesk — configure accordingly.

## Data Sync

| Entity | Direction | Details |
|--------|-----------|---------|
| Contacts | ↔ Bi-directional | Matched by email; new contacts created in Salesforce if no match found |
| Accounts | ↔ Bi-directional | Linked via contact-account relationship in Salesforce |
| Opportunities | ↔ Bi-directional | Deal stage changes sync both ways; meetings logged to related opportunity |
| Activities | → Demodesk to Salesforce | Completed meetings create Tasks/Events in Salesforce |
| Tasks | → Demodesk to Salesforce | Action items from AI summaries created as open Tasks |
| Notes | → Demodesk to Salesforce | AI summaries and meeting notes attached to opportunity or contact |
| Custom Objects | ↔ Configurable | Direction depends on field mapping configuration |

Sync is real-time and event-driven. Batch re-sync can be triggered manually from the Sync Log screen.

## Example Prompts

- "Connect my Salesforce account to Demodesk"
- "Map the meeting summary field to a custom Salesforce object called Meeting_Intelligence__c"
- "Show me which Salesforce fields are currently mapped in my Demodesk integration"
- "My Salesforce sync is failing — help me check the sync log and fix it"
