{"title":"Manage standard object sync","slug":"per-record-sync-opt-in","url":"https://support.storeconnect.com/articles/per-record-sync-opt-in","url_markdown":"https://support.storeconnect.com/articles/per-record-sync-opt-in.md","subtitle":null,"summary":"Control which individual records on a standard Salesforce object sync to StoreConnect by creating an opt-in field. Useful for organizations with large record volumes where only a subset of records are relevant to StoreConnect.","type":"Help_Documentation","video_url":"","keywords":"sync opt-in, selective sync, storeconnect sync, StoreConnect_Sync__c, enable_sync, per-record sync, filter sync records, sync","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"By default, StoreConnect syncs every record on the standard objects it monitors, whether or not your store needs those records.\n\nIf you have a large volume of Salesforce records (such as millions of **Contact** or **Account** records), you can select which records get included in the sync process, speeding up processing time. When enabled for an object, only records you explicitly select for sync will sync; all others are ignored.\n\n:::note\nRecords that already existed in Salesforce before you installed StoreConnect are a separate matter. Pre-existing Accounts and Contacts are not brought across when you set up your store, and they need a StoreConnect ID before your website can use them. See [initial sync when setting up the sync user](initial-sync).\n:::\n\n:::note\nThis feature applies to **standard Salesforce objects only** (such as Contact, Account, and Product2). Custom objects always sync all records and are not affected.\n:::\n\n## Configuration sequence for new StoreConnect users\n\nThe best time to configure this feature is before your store is created. The ideal sequence is:\n\n1. Install the StoreConnect package.\n2. Configure sync for the objects you want to filter (this article).\n3. Run StoreConnect Setup.\n\nThe initial sync of your Salesforce data into StoreConnect happens during setup. Configuring the sync objects before running setup means only the records you've explicitly selected are included in that first sync, avoiding the need to clean up unwanted records later. Fewer records also means Setup completes faster, so your store is ready to use sooner.\n\nIf you configure this feature after setup has already run (that is, after your store setup has been triggered), you will need to carefully prepare your existing records before enabling it, as any records without `enable_sync` set will be removed from your store.\n\n:::warning\n**Existing StoreConnect users:** Enabling this feature on an object with an existing store without first preparing your records can result in data becoming out of sync. Any records you do not explicitly mark `enable_sync` will stop syncing and will be removed from StoreConnect.\n:::\n\n## How it works\n\nFirst, you create a custom field in Salesforce. When the field exists on an object, StoreConnect checks its value on each record before generating a sync event:\n\n- Records with the value `enable_sync` are included in synchronization\n- Records with any other value, or no value, are excluded\n\nIf the field does not exist on an object, all records for that object sync as before. The feature is fully backward compatible, and adding it to one object has no effect on any other.\n\n## Each object is filtered separately\n\nThe opt-in check runs per object and per record. StoreConnect does not follow relationships when it decides whether a record syncs: each record is included or excluded on the value of its own `StoreConnect_Sync__c` field, no matter what its parent or child records do.\n\nTwo things follow from this:\n\n- Adding the field to a parent object has no effect on any child object. Child objects that do not have the field keep syncing all of their records.\n- Excluding a parent record does not exclude its children. Children that still sync arrive in your store with no parent record to attach to, and stay that way until the parent syncs.\n\nSo to keep a record and everything below it out of the sync, you must add the field to **every** standard object in that tree, and leave every record in the tree without `enable_sync`.\n\n### Example: keeping an order out of the sync\n\nAn Order and its Order Items are two separate standard objects, so each one needs its own StoreConnect Sync field.\n\n| What you configure | What syncs |\n|---|---|\n| Field on **Order** only, order not opted in | The order is excluded, but all **Order Items** keep syncing, including the excluded order's line items |\n| Field on **Order** and **Order Item**, neither opted in | Both the order and its line items are excluded |\n| Field on **Order** and **Order Item**, order opted in but items not | The order syncs with no line items |\n| Field on **Order** and **Order Item**, both opted in | The order and its line items sync |\n\nThe same rule applies to any other parent and child pair on standard objects, including **Account** and **Contact** (see the warning in [Step 2](#step-2-enable-sync-on-required-records)).\n\n:::warning\n**Custom objects cannot be excluded.** Records related to an order on custom objects, such as Payments, Order Fulfillments, Order Item Taxes, Order Campaigns, and promotion or reward credits, always sync in full because opt-in filtering does not apply to custom objects. If you exclude an order, any of these records that reference it still sync and sit in your store without their parent order.\n:::\n\n## Decide how to treat existing records\n\nAny record that you want to sync needs to have the `enable_sync` option set. Existing records do not have this field and won't be synced. We recommend that you:\n\n- Identify which records you want to enable sync for\n- Identify and remove any records you no longer need\n\n## Step 1: Add the `StoreConnect_sync` field\n\n1. In Salesforce, select the gear icon and select **Setup**.\n2. In the **Quick Find** box, search for **Object Manager**.\n3. Select the standard object you want to filter (for example, **Contact**).\n4. Select **Fields \u0026 Relationships**, then **New**.\n5. Select **Text** as the field type and select **Next**.\n\n   :::note\n   Picklist and text area field types are also supported if you prefer a controlled value set or need a longer field.\n   :::\n\n6. Set the **Field Label** to `StoreConnect Sync` and confirm the **Field Name** is automatically set to `StoreConnect_Sync`.\n7. Complete the remaining field settings and select **Save**.\n\nOnce the field exists on the object, opt-in filtering is active immediately for all future sync events on that object.\n\nRepeat these steps for every standard object you want to filter. If your goal is to exclude a record and its related records, that means adding the field to the child objects as well, for example to both **Order** and **Order Item**. See [each object is filtered separately](#each-object-is-filtered-separately).\n\n:::note\nIf your org uses Person Accounts, you must add the `StoreConnect Sync` field to both the Account and Contact objects separately. When creating the Account field, do not use the **Available for Person Accounts** option, because that creates the field with a `__pc` suffix on **Account**, which StoreConnect does not recognize. Create the field as a standard text field on each object so both get the required `StoreConnect_Sync__c` API name.\n:::\n\n## Step 2: Enable sync on required records\n\nFor each record that you want to sync to StoreConnect, set the `StoreConnect_Sync__c` field value to `enable_sync`.\n\nYou can do this in bulk using:\n\n- **Data Loader** — update records via CSV export and import\n- **Salesforce Flow** — build a scheduled flow to set the value on matching records\n- **Reports and List Views** — use inline editing or mass update tools\n\nRecords where the field is blank or set to any other value will not sync.\n\n:::warning\n**Accounts and Contacts must be enabled together.** If you add the `StoreConnect_Sync__c` field to both Account and Contact, make sure you enable sync on both the Account record and its related Contact records at the same time. If a Contact syncs but its parent Account does not, StoreConnect may create a duplicate account. If an Account syncs but its Contacts do not, StoreConnect may create duplicate contacts. This applies to both business accounts and Person Accounts.\n\nFor Person Accounts, see [Step 3](#step-3-keep-person-account-and-contact-fields-in-sync) for how to automate this with a Flow.\n:::\n\n## Step 3: Keep Person Account and Contact fields in sync (Person Accounts only)\n\nBecause a Person Account's Account and Contact records have separate `StoreConnect_Sync__c` fields, they can get out of sync, for example if you update one in bulk but not the other. To prevent this, create a record-triggered Flow on Account that automatically mirrors any change to `StoreConnect_Sync__c` onto the linked Contact record:\n\n1. In Salesforce **Setup**, open **Flow Builder** and create a new **Record-Triggered Flow**.\n2. Set the object to **Account** and the trigger to run when a record is **Updated**, optimized for **Actions and Related Records**.\n3. Add an entry condition: **IsPersonAccount** equals `True`.\n4. Add a second entry condition: **StoreConnect Sync** (`StoreConnect_Sync__c`) **Is Changed** equals `True`.\n5. Add an **Update Records** action:\n   - Select **Use the account's Person Contact ID to find records** (or relate to the Contact via `PersonContactId`).\n   - Set `StoreConnect_Sync__c` on the Contact to the value of `{!$Record.StoreConnect_Sync__c}`.\n6. Save and activate the flow.\n\nOnce active, any change to `StoreConnect_Sync__c` on a **Person Account** (whether made manually, in bulk via Data Loader, or by another Flow) is automatically reflected on the linked Contact.\n\n## Step 4: Auto-enable sync for store-created records (optional)\n\nWhen a new customer registers or checks out, you may want those records immediately included in the sync process. You can do this with standard Salesforce field configuration; no Flow is required.\n\nSet a formula-based **Default Value** on the `StoreConnect_Sync__c` field so that whenever the StoreConnect sync user creates a record, the field is pre-populated with `enable_sync`:\n\n1. In Salesforce Setup, open **Object Manager** and select the object (for example, **Contact**).\n2. Select **Fields \u0026 Relationships** and open the **StoreConnect Sync** field.\n3. Select **Edit**.\n4. In the **Default Value** field, enter the following formula:\n\n   ```\n   IF($Permission.storeConnect_Sync, \"enable_sync\", null)\n   ```\n\n5. Save the field.\n\nThis formula evaluates at record creation time. Because only the StoreConnect sync user should hold the `storeConnect_Sync` custom permission, the field is set to `enable_sync` only for records that user creates. Records created by other Salesforce users have no default value applied and are treated separately.\n\n## Confirm the filter is working\n\n1. Set `StoreConnect_Sync__c` to `enable_sync` on one test record and save it.\n2. Open [sync summaries](sync-summaries) and check the **SC Row Count** for that object. It should rise by one, allowing up to 3 minutes for the summary to refresh.\n3. Save a record on the same object with the field blank, and confirm the **SC Row Count** does not change.\n\n## When the sync value changes\n\nStoreConnect handles transitions automatically when the `StoreConnect_Sync__c` value is updated on a record:\n\n| Previous value | New value | What happens |\n|---|---|---|\n| Not `enable_sync` | `enable_sync` | Record is sent to StoreConnect as a full insert |\n| `enable_sync` | Not `enable_sync` | Record is removed from StoreConnect |\n| `enable_sync` | `enable_sync` | Normal update sync, only changed fields are sent |\n| Not `enable_sync` | Not `enable_sync` | No sync event generated |\n\nThis means you can add or remove records from sync at any time simply by updating the field value, with no manual cleanup required for those records.\n\n## Disable sync on a record\n\nTo stop selective syncing and return to syncing all records on an object, delete the `StoreConnect_Sync__c` field from that object in Salesforce Setup. All records will resume syncing automatically on their next change."}