> For the complete documentation index, see [llms.txt](https://docs.kernel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kernel.ai/integrations/salesforce-integration/record-sync-backfill-and-schedules.md).

# Set up Record Sync and schedules

Link existing Accounts, copy selected fields between Account and Kernel Account, and schedule Salesforce Record Sync jobs.

Use **Record Sync** in Salesforce to copy selected fields between Account and Kernel Account. This page covers linking existing records, configuring the copy, checking a first run, and scheduling future runs.

The Kernel web app controls Salesforce imports and **CRM push** mappings. Its **In-CRM sync** area also supports mappings between Salesforce objects. The instructions below use the Salesforce package's **Record Sync** and **Sync Schedules** screens. For the web app, see [CRM](https://docs.kernel.ai/platform/crm).

The steps and labels on this page use package version 3.13.0. Check your installed version under **Setup → Installed Packages**. See [Recent package changes](https://docs.kernel.ai/integrations/salesforce-integration/recent-package-changes) for features added in earlier versions.

### Before you start

* Complete the [package installation and connection](https://docs.kernel.ai/integrations/salesforce-integration/package-installation-guide).
* Have a Salesforce administrator complete backfill and the initial configuration. Use the [integration user permission matrix](https://docs.kernel.ai/integrations/salesforce-integration/salesforce-integration-user-permission-matrix) to check the access required for the people and integration user involved.
* Choose the source and destination for each field. Check access for the user who will run or schedule the copy, as well as the integration user used by the Kernel web app.
* Choose one known source record and one mapped value to check after your first sync.

Record Sync copies values already stored in Salesforce. It does not request fresh Kernel enrichment. If you need updated enrichment, complete that step before copying its results to Account.

### Confirm the data route

Kernel recommends writing enrichment to Kernel Account so you can review it separately from your Salesforce Account fields.

| Stage                                  | Where to configure it                                    | What to check                                            |
| -------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| Read Salesforce data into Kernel       | The Kernel web app's CRM settings                        | The source object, selected fields, and records in scope |
| Write Kernel data to Salesforce        | **CRM → Configuration → CRM push** in the Kernel web app | The destination object and enabled fields                |
| Copy values between Salesforce objects | **Kernel Setup → Record Sync** in Salesforce             | The direction, link fields, mapped fields, and filter    |

If Kernel reads directly from Account, it can use Account fields without first copying extra fields to Kernel Account. If your setup reads from Kernel Account, configure **Account → Kernel Account** to populate the source fields Kernel needs before importing them.

For the custom object route, establish the Account links first. Then verify that a **CRM push** reaches Kernel Account before testing a copy from Kernel Account to Account.

See [Kernel Account fields and links](https://docs.kernel.ai/integrations/salesforce-integration/custom-object) for the object and field definitions.

### Link existing Accounts

**Run Backfill** prepares existing Accounts for the custom object route. It selects Accounts whose **Kernel Account** lookup is blank, reuses an existing linked Kernel Account where available, or creates a minimal Kernel Account record. It then writes the lookup on Account.

Backfill leaves populated Account lookups untouched. Its scope is all Accounts with that lookup blank. The filter on a Record Sync configuration does not limit backfill.

1. In Salesforce, open **Kernel** from the **App Launcher**.
2. Open **Kernel Setup → Record Sync**.
3. In **Backfill Kernel Accounts**, click **Run Backfill**.
4. Wait for the run to finish. Use **View Apex Jobs** to inspect the job status and errors.
5. Open a known Account and check its **Kernel Account** lookup. Open that Kernel Account and check that **Linked Account** points back to the same Account.

Backfill creates records and links. Kernel enrichment reaches those records through your configured CRM push.

If one lookup is still blank, follow [Troubleshoot sync](https://docs.kernel.ai/integrations/salesforce-integration/troubleshoot-sync#an-account-link-is-missing) before running the field copy.

### Configure the field copy

1. In **Record Sync**, set **Configuration Mode** to **Standard**.
2. Select the required **Sync Direction**.
3. Check the source, target, and key fields shown on the page.

| Sync direction               | Source object       | Source key | Target object       | Target key                |
| ---------------------------- | ------------------- | ---------- | ------------------- | ------------------------- |
| **Account → Kernel Account** | `Account`           | `Id`       | `Kernel_Account__c` | `Linked_Account_Field__c` |
| **Kernel Account → Account** | `Kernel_Account__c` | `Id`       | `Account`           | `Kernel_Account__c`       |

The key fields identify the matching Salesforce records. A KERN ID field is separate from these lookup fields.

#### Select the fields

In **Field Mapping**, use **Add New Mapping** to choose each **Source Field** and **Target Field**.

For **Account → Kernel Account**, the Standard screen includes these locked mappings:

| Account field | Kernel Account field |
| ------------- | -------------------- |
| `Name`        | `Name`               |
| `Website`     | `Kernel_Website__c`  |

Running this direction can update the name and website held on Kernel Account. Add any other fields your setup needs to copy. If Kernel reads Account directly, extra mappings may be unnecessary.

For **Kernel Account → Account**, add only the fields you want to maintain on Account. The default reverse configuration supplied from version 3.12.7 has no field mappings, so it does not copy Kernel Account's name into Account automatically. Review the mappings already saved in your org, especially after an upgrade.

Check each target field's data type and length as well as its label. Two fields labelled **KERN ID** can belong to different objects and have different API names.

#### Set the scope and save

1. Open the **Sync** step.
2. For the first run, use **Query Filter (Optional)** to select your known source record. Enter `Id = '<source Salesforce record ID>'`, replacing the placeholder with that record's full Salesforce ID.
3. Enter only the filter condition. Leave out the `WHERE` keyword and the rest of the SOQL query.
4. Click **Save Configuration**.
5. Click **Run Sync Now** to start the copy.

The filter selects records on the **source object**. For **Kernel Account → Account**, `Id` means the Kernel Account record ID. For **Account → Kernel Account**, it means the Account record ID.

Saving stores the objects, keys, mappings, and filter for future runs. **Run Sync Now** starts the job in the background.

A blank filter leaves the source query unrestricted by a custom condition. In version 3.12.0 and later, saved filters apply to manual, scheduled, and API-triggered syncs. The filter belongs to this Record Sync configuration. Review the Kernel web app's import scope separately if it reads directly from Account.

#### Example: fill an empty Account website

To copy a website from Kernel Account only when the linked Account's Website is empty:

1. Confirm both lookup fields point to the same Account and Kernel Account pair.
2. Select **Kernel Account → Account**.
3. Map `Kernel_Website__c` to `Website`. Keep this configuration limited to the field you intend to fill.
4. In **Query Filter (Optional)**, enter:

```
Linked_Account_Field__c != null AND Linked_Account_Field__r.Website = null AND Kernel_Website__c != null
```

5. For the first run, add `AND Id = '<Kernel Account record ID>'` using a known record with an empty Account website.
6. Save, run, and check the target Website. Then remove the single-record condition and save the intended scope before scheduling.

`Linked_Account_Field__r.Website` reads Website on the Account linked from the source Kernel Account. The filter checks whether it is empty when the job selects the source records. The mapping defines which value to copy and where to write it.

The filter applies to the whole configuration, including every field mapped in it. Use a separate configuration for fields with different fill conditions. This is a scheduled copy; it runs at the cadence you choose below.

### Check the result

Before widening the filter or adding a schedule:

1. Wait for the job to finish. Check its status and any errors through **View Apex Jobs**.
2. Open the source record and confirm the value you expected to copy.
3. Follow the lookup to the target record and check the exact mapped field.
4. Review any sync failure summary in **Kernel Application Logs**. A finished job still needs an outcome check against the records you selected.

For a CRM push from the Kernel web app, open **CRM → Syncs**, find the run, and open **Monitor**. Check its successes and errors, then confirm the value on the Salesforce destination record.

Once the first record is correct, update and save the filter for the intended record population. Repeat the result check after the wider run. See [Troubleshoot sync](https://docs.kernel.ai/integrations/salesforce-integration/troubleshoot-sync) if values are missing or the run contains failures.

### Schedule the Salesforce copy

1. Open **Kernel Setup → Sync Schedules** in Salesforce.
2. Choose which configurations to run. Leave **Run all active sync configs** selected to include every active configuration, including ones added later. Clear it and use **Configs to sync** to select specific configurations.
3. Set **Frequency** to **Daily** or **Hourly**.
4. For a daily schedule, enter the hour and minute. For an hourly schedule, enter the minute past each hour. Salesforce uses the timezone of the user who creates the schedule.
5. Review **Job Name Preview** and click **Schedule**.
6. Check **Next Run** in the scheduled jobs table to confirm the intended timing.
7. After that time, check **Recent Job Runs** and confirm a mapped value on a target record.

For another cadence, select **Advanced (custom cron expression)**, enter the six-field **Cron Expression** and a **Schedule Label**, then review the preview before scheduling. See Salesforce's [scheduled Apex guidance](https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_scheduled) for cron syntax and scheduling timezones.

**Recent Job Runs** is available from version 3.13.0. It shows the five most recent Record Sync batch jobs, including manual and scheduled runs. A schedule that includes several configurations starts a separate batch job for each configuration. The scheduled jobs table shows the schedule and its next run.

### Automatic refresh from Kernel

The Salesforce schedule above controls field copies between Salesforce objects. In the Kernel web app, **Connection** contains **Automatic refresh frequency**, which controls how often Kernel writes changed values back to Salesforce. The available frequencies are **Daily**, **Weekly**, **Monthly**, and **Never**.

Each automatic refresh sends accounts whose Kernel values changed since the previous run. Check that the new value has reached Kernel Account before expecting a Salesforce copy to place it on Account.

See [Automatic refresh](https://docs.kernel.ai/integrations/salesforce-integration/enrich-with-kernel) for the refresh cadence and the **Enrich with Kernel** action on an individual Account.
