How to Prevent Duplicate Create and Update Transmissions
Why Do Duplicate Transmissions Occur?
When Pulsar successfully sends an offline-created or updated record to the server, it typically receives a success confirmation. However, this confirmation can sometimes fail due to a server timeout or other interruptions during the transmission.
If a sync resumes after such an interruption, Pulsar cannot confirm whether the last create or update operation succeeded. To prevent data loss, Pulsar assumes the operation did not complete and retransmits the record. This may result in:
Duplicate records if a Create is retransmitted.
Unintended updates if an Update is resent.
How to Prevent Duplicate Transmissions?
You can use the pulsar.sync.duplicateCheckField data sync setting to prevent duplicate transmissions. Here’s how it works:
Unique Transmission ID: Pulsar generates a unique ID for each record per transmission and stores it in the field specified by the duplicateCheckField setting.
Validation on Subsequent Syncs: Pulsar queries Salesforce using the unique ID to check if the record already exists before resending a record.
If a matching record is found, Pulsar skips the Create or Update operation and proceeds as if the record was successfully transmitted.
When does Pulsar run Duplicate Checking?
Pulsar performs the duplicate check only under specific conditions during the sync process. Duplicate checking will run all of these conditions are met:
The user is resuming an interrupted sync.
The sync was interrupted during the resolve stage (while Pulsar is pushing local changes).
There are pending changes to push.
The duplicate check is only run once, when first resuming the sync, and only for the record(s) being pushed in the transmission unit of the interrupted sync.
Steps to Enable Duplicate Checking
To enable this feature, follow these steps:
Specify a Field Name: Configure the pulsar.sync.duplicateCheckField setting with a valid field API name.
Prepare Each Object:
Use an existing text field or add a new text field to the object with the same name specified in the pulsar.sync.duplicateCheckField setting.
Ensure the text field supports at least 50 characters and is marked as an External ID.
Handling Composite API Settings
If using compositeAPI or compositeGraphAPI for batch operations:
Pulsar automatically separates batch groups to ensure objects without a duplicate check field are not mixed with objects with a duplicate check field.
This allows Pulsar to:
Resend the objects without a duplicate check field if needed.
Check for duplicates in the objects with a duplicate check field as a single unit.
Further Information
For detailed setup instructions, visit the Data Sync Settings page in Pulsar for Salesforce Documentation.
By implementing this feature, you can significantly reduce the risk of duplicate records and unintended updates, ensuring smoother and more reliable data synchronization.