Question

The legacy Salesforce integration included a sync-many function. How do I do something similar with the new Salesforce integration?

Answer

Data volume considerations

Before you sync large datasets, understand these limitations:

API rate limits

  • Salesforce API calls Bulk operations consume API calls based on your Salesforce edition
  • Daily limits vary Professional limits are 1,000 calls per day. Enterprise limits are 5,000 calls per day. Unlimited limits are 20,000 calls per day per user.
  • Monitor usage Check the usage in Salesforce Setup System Overview API Usage
  • Other integrations The Zendesk sync shares the API quota with all other Salesforce integrations

Batch size recommendations

  • Optimal batch size is 200 to 500 records at a time
  • Why limit batch size It prevents Salesforce timeouts, reduces the risk of partial failure, and makes it easier to resolve sync errors. The time limit per transaction is 30 seconds.
  • For very large syncs Break the operation into multiple sessions over several days

Streaming API event limits

  • Push Topics Salesforce editions have daily event delivery limits
    • Professional is 10,000 events per day
    • Enterprise is 200,000 events per day
    • Unlimited is 500,000 events per day
  • What counts as an event Each individual record change generates one event

Processing time

  • Expect 30 to 60 minutes for batches of 500 records
  • Don't panic Large batches take hours, not minutes
  • Monitor progress See if the sync started and check the progress in the integration log in Admin Center
Warning: For datasets with more than 10,000 records, contact Zendesk Customer Support for further help with phased sync guidance. Schedule the sync during off-hours, and coordinate with your Salesforce admin so you don't break other integrations or exhaust API quotas.

Sync process

A data sync triggers when a mapped field updates in a Salesforce record, or if you create a new record. Updated unmapped fields don't trigger the sync. See Configuring Data Sync from Salesforce to Zendesk.

The legacy integration didn't fire when records were created or updated, either in batches or when you use the Salesforce API. A manual batch sync was required to update Zendesk for any records created or updated in this fashion.

The new Salesforce integration doesn't have this limitation. Batch updates and API updates trigger a sync over to Zendesk, provided one of the mapped fields changes. To accomplish a batch sync function:

Note: The sync uses the Salesforce streaming API. As such, it is subject to their rate limits for different plan levels. The relevant limit is the maximum number of delivered event notifications within a 24-hour period, shared by all CometD clients. If you exceed this limit, the integration deactivates the sync.

To check your current rate limit usage, see How can I check my Streaming API limits and usage?

Although this example deals specifically with how to sync accounts, a similar method can sync contacts or leads. While this explanation includes how to create a new custom field within Salesforce, a checkbox field isn't required for this method. The only requirement is that a non-formula field is present in SFDC and mapped within Admin Center, which you can modify in batches to trigger the streaming API event on which the sync is based.

To sync many records with two built-in SFDC tools:

  1. Create a custom checkbox organization field in Zendesk called Sync with Salesforce
    sync with salesforce - custom checkbox
  2. Create a checkbox account field in Salesforce called Sync with Zendesk with a default value of False
    sync with zendesk checkbox
  3. Map the two fields to each other in the Admin Center at yoursubdomain.zendesk.com/admin/platform/integrations/salesforce/accounts_organizations
    Field mapping in Admin Center
  4. Create a report in SFDC that includes two pieces of information:
    • SFDC account ID
    • The Sync with Zendesk account field from step 2
      All accounts report with Account ID and Sync with Zendesk account fieldScreen_Shot_2020-01-06_at_11.09.24_AM.png
  5. Export the detail rows of the report from step 4 as a CSV
    Export rows
    Export rows - Details Only
  6. In the spreadsheet editor of your choice, update the Sync with Zendesk column of the CSV file to be the opposite of whatever it was before. If it was false, then set to true or the opposite.
  7. Import the updated CSV back into SFDC, with a tool such as Dataloader, to update all the accounts. Use the BATCH API and not the Bulk API for this upsert or update.
    Import using Dataloader 1
    Import using Dataloader 2
    Import using Dataloader 3

    Import using Dataloader 4
  8. After you update the SFDC records, allow some time for the background jobs to complete. This timeframe varies depending on the number of records you sync. For a few hundred records, this might only take a few minutes. For tens of thousands of records, it might take thirty minutes to an hour.
  9. After all records sync, remove the mapping from step 3 and delete the fields created in steps 1 and 2. Alternately, leave them in place to manually trigger a sync in the future.
Note: These steps describe the import process with Dataloader. Other Salesforce import tools can also work with the Zendesk integration. However, they must use the Batch API and not Bulk API for the import. The reason for this is that BULK updates don't generate the Push Topic events on which the sync relies, because of this limitation of the Salesforce API. For example, at the time of this writing, the G-Connector extension doesn't support the use of the Batch API, so updates made to SFDC records with that tool won't trigger the sync.
Powered by Zendesk