iSyncSFDocumentation

#iSyncSF Troubleshooting Guide

This guide walks you through the most common issues encountered when using iSyncSF, with structured diagnostic steps and resolution strategies for each scenario.

#Before You Start Troubleshooting

Before diving into a specific issue, gather the following information:

Check the Application Logs

Navigate to the Application Logs tab in iSyncSF. These logs capture operational errors such as connection failures, batch crashes, and unexpected exceptions. Filter by the template or job in question to narrow results.

Check the DataSyncAuditLog

The DataSyncAuditLog is the most important diagnostic object. Each record represents a single source record processed during a sync job. Filter by HasError = true to find all records that failed, and review the ErrorMessage field for Salesforce-level error details.

Verify the Sync Job Status

Open the sync job record and check the Status field. Common statuses include:

Set the Log Level

For detailed diagnostics, set the DebugLevel system property to DEBUG or FINEST before reproducing the issue. The default level is ERROR, which only captures errors. After troubleshooting, reset to ERROR to reduce log volume. See the System Configuration Reference for instructions.


#Scan or Preview Not Starting

Symptom: The sync job status remains at "Scan In Progress" for an extended period with no visible progress, or the scan never transitions to "Scanned."

What to Check

  1. Are there other batch jobs running? Salesforce allows a maximum of five concurrent batch jobs. If all five slots are occupied by other processes, the iSyncSF scan batch sits in the holding queue. Wait for other batches to finish, or abort unnecessary batch jobs from Salesforce Setup > Apex Jobs.
  2. Check the child job statuses. Open the sync job record and review its related child job records. If all child jobs show "Completed" or "Queued" but the master job is still "Scan In Progress," the batch chain may have been interrupted between steps.
  3. Is the Preview Batch Size too large? A high PreviewBatchSize on the template causes the scan to process too many records per batch iteration, potentially exhausting governor limits. Reduce it to 50 or lower and re-run the scan.
  4. Deep self-referencing hierarchies. Objects with deep parent-child hierarchies referencing themselves (such as Account > ParentId) can cause the hierarchy computation to fail. If you suspect this, enable the UseKahnsAlgorithm system property (set it to true) to switch to an iterative hierarchy computation that handles deep hierarchies safely.
  5. MaxInternalBatches too low. The scan engine processes records in internal iterations. If the MaxInternalBatches system property is too low, the scan may exit before completing all phases. Increase it (for example, from 50 to 200).

Resolution


#Sync Running but Records Not Appearing in Target

Symptom: The sync job completes with status "Synced," but some or all expected records are missing from the target org.

What to Check

  1. Review the DataSyncAuditLog status codes. Each audit log record has a StatusCode that tells you exactly what happened to that record:
    • 7 (Inserted) — Record was successfully created in the target. If it is not visible, it may be hidden by sharing rules. Verify the Destination_Record_ID field and search for it directly in the target org.
    • 2 (Updated) — Record was matched and updated in the target.
    • 4 (Existing) — Record was matched but intentionally skipped because UpdateExistingRecords is set to false on the Object Settings. Enable this setting if you want updates.
    • 5 (Source N/A) — The source record was deleted or became inaccessible between the scan and sync phases.
    • 1 (Insert Error) or 3 (Update Error) — The record failed. Check the ErrorMessage field for the specific Salesforce error.
  2. Check the template line filter. Review the SOQL WHERE clause on the template line. A restrictive filter may exclude the records you expect to see.
  3. Delta Sync date filter. If Delta Sync (ContinuousSync) is enabled, only records modified after the Last Sync Date are included. If the Last Sync Date is set ahead of the records' modification dates, those records will be excluded. Clear the Last Sync Date on the template to force a full re-sync.
  4. Parent-child ordering. Ensure parent objects have lower Sequence numbers than child objects in the template lines. If a child is synced before its parent, the child's lookup field will not resolve and the record will fail.
  5. Sharing and field-level security. The running user must have access to the source records. If OWD for the object is Private, consider enabling the OverrideRecordSharing option.

Resolution


#Validation Rule and Automation Failures

Symptom: Records fail with errors such as FIELD_CUSTOM_VALIDATION_EXCEPTION, REQUIRED_FIELD_MISSING, or CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY (trigger errors).

What to Check

  1. Identify the failing validation rule. The ErrorMessage in the DataSyncAuditLog contains the validation rule's error text. Use this to locate the specific rule in the target org.
  2. Required fields missing. If the error is REQUIRED_FIELD_MISSING, a field required in the target org is either null in the source data or not mapped. Add an Object Field Mapping with an Expression to supply a default value.
  3. Trigger errors. If target org triggers are causing failures, use Automation Control to disable them before syncing.
  4. Duplicate rules. DUPLICATES_DETECTED fires when a Duplicate Rule matches the incoming record. Set a CustomExternalID on Object Settings to use upsert instead of insert, which bypasses duplicate rule evaluation on inserts.

Resolution


#OAuth and Connection Errors

Symptom: Target org connection fails. The Org Master record shows "Token Expired," "Not Connected," or "Error" status. Sync jobs fail with callout errors.

What to Check

  1. Check the Org Master record. Open the Org Master record for the target org. The OAuthStatus field shows the current connection state. The OAuthLastError field shows the most recent error message.
    • "Token Expired" — The access token expired and the refresh failed. The most common cause is a revoked refresh token (the Connected App was modified, or the admin revoked all tokens).
    • "Not Connected" — The org was never connected or was intentionally disconnected. Initiate the OAuth flow from the Org Connection page.
    • "invalid_grant" in the error message — The refresh token is no longer valid. You must re-authorize by disconnecting and reconnecting the org.
  2. Is the OAuth Token Refresh scheduled job running? iSyncSF includes an hourly scheduled job that proactively refreshes tokens before they expire. If this job is not scheduled, tokens will expire after approximately two hours. Check the Scheduled Jobs tab in the Setup Assistant and ensure the OAuth Token Refresh job is active.
  3. Remote Site Settings. Verify that the target org's instance URL is registered as a Remote Site Setting in Salesforce Setup. iSyncSF attempts to create these automatically, but the auto-creation can fail silently.
  4. Callback URL mismatch. If the OAuth authorization flow itself fails, verify that the callback URL configured in the Connected App matches the one stored in iSyncSF's system configuration.
  5. Connected App scopes. Ensure the Connected App includes the api, refresh_token, and offline_access scopes. Without refresh_token, no refresh token is issued and the connection expires permanently after the initial access token times out.

Resolution


#Performance and Governor Limit Issues

Symptom: Sync jobs take significantly longer than expected, or you see errors related to SOQL query limits, CPU time limits, or callout size limits.

What to Check

  1. MaxBatchSize too high. The MaxBatchSize on Object Settings controls how many records are sent per callout to the target org. A value above 200 with objects that have many fields can generate payloads that exceed Salesforce's 12 MB callout limit (System.CalloutException: Exceeded max size limit). Reduce it to 50–100 for objects with large numbers of fields or rich text fields.
  2. ExternalMaxbatch on the template. This setting controls the total number of records sent per callout cycle. Reduce it if you see callout size errors.
  3. Too Many SOQL Queries (101). This typically happens when relationship resolution runs per-record rather than in bulk. iSyncSF handles this automatically during the pre-scan, but a very high batch size can push the query count over the limit. Reduce MaxBatchSize.
  4. Concurrent sync jobs. iSyncSF allows up to five sync jobs running simultaneously. Each job competes for batch execution slots and API limits. If performance is critical, run fewer concurrent jobs.
  5. Target org automation overhead. Validation rules, triggers, and flows on the target org execute for every record inserted or updated. This slows down the sync and can cause timeout errors. Use Automation Control to disable target automations during bulk syncs.
  6. Deep self-referencing hierarchies. Objects with deep parent-child self-references (10+ levels) cause expensive hierarchy computation. Enable UseKahnsAlgorithm for better performance.
  7. MaxLimitUsage threshold. The MaxLimitUsage setting (default 80%) controls how much of the governor limit budget the engine uses before pausing. If set too low (for example, 50%), the engine pauses frequently, adding overhead from batch restarts. If set too high (above 90%), you risk governor limit exceptions.

Resolution


#Rollback Not Working

Symptom: Rollback does not delete records from the target org, does not restore original values, or gets stuck at "Rollback Started."

What to Check

  1. Were records inserted or only updated? Rollback in delete mode only processes records with status code 7 (Inserted). If all synced records were updates (status code 2), rollback has nothing to delete. To restore updated records to their pre-sync values, Data Versioning must have been enabled before the sync ran.
  2. Rollback permission. The user needs the TemplateRollbackSync custom permission to initiate a rollback. Check the permission assignment.
  3. OAuth token validity. Rollback makes callouts to the target org to delete records. If the OAuth token has expired, the rollback will fail silently. Refresh the connection and retry.
  4. Target org permissions. The integration user on the target org must have delete permission on the affected objects. Without delete access, the rollback scripts fail.
  5. Stuck rollback batch. If the job is stuck at "Rollback Started," check Salesforce Setup > Apex Jobs for the rollback batch job status. If it failed, reset the job status back to "Synced" and re-initiate the rollback.
  6. Data Versioning not enabled. If you expected rollback to restore updated field values and it did not, verify that the EnableVersion system property was set to true before the sync was executed. Versioning only captures snapshots during the sync if it is enabled at that time.

Resolution


#Reading the DataSyncAuditLog

The DataSyncAuditLog is iSyncSF's central diagnostic object. Understanding its fields is essential for troubleshooting any sync issue.

Key Fields

Field Purpose
Name The source record's Salesforce ID.
SObjectType The API name of the object (for example, Account, Contact).
StatusCode Numeric code indicating the result (see table below).
StatusText Human-readable description of the status.
ErrorMessage The full Salesforce error text when the record failed.
HasError Boolean flag — true if the record encountered an error.
Destination_Record_ID The ID of the record in the target org (populated after successful insert or update).
Destination_Org_ID The Org ID of the target org.
Sequence The processing order number for this object within the sync job.
SubSequence The depth level for self-referencing hierarchies (0 = top level).
IsParent Whether this record is treated as a parent object in the relationship hierarchy.
Order The computed insertion order within its object group.
UpdateRequired Whether the record was flagged for update (matched by external ID or mapping key).

Status Codes Reference

Code Meaning Action
1 Insert Error Check ErrorMessage for the specific Salesforce error. Fix the root cause and use Retry.
2 Updated Record was matched and updated successfully. No action needed.
3 Update Error Check ErrorMessage. Verify the matched record still exists in the target.
4 Existing (Skipped) Record matched but UpdateExistingRecords is false. Enable it if updates are desired.
5 Source N/A Source record was deleted or became inaccessible after the scan.
6 Default Record used a default mapping (for example, User mapped to the DefaultUserID). Expected behavior.
7 Inserted Record was successfully created in the target org. No action needed.
9 Pre-processing Record is in the pre-processing state. If this persists after the job completes, the sync may have been interrupted.
11 Sent to File Migration Service Large file (>5 MB) was handed off to the external relay for transfer. Final status will be updated when the relay completes.

How to Filter Audit Logs

From the sync job record, navigate to the related DataSyncAuditLog list. Use these filter strategies:

For additional troubleshooting patterns, see the FAQ for answers to specific error codes.