Manage standard object sync
On this page
By default, StoreConnect syncs every record on the standard objects it monitors, whether or not your store needs those records.
If 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.
:::note Records 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. :::
:::note This feature applies to standard Salesforce objects only (such as Contact, Account, and Product2). Custom objects always sync all records and are not affected. :::
Configuration sequence for new StoreConnect users
The best time to configure this feature is before your store is created. The ideal sequence is:
- Install the StoreConnect package.
- Configure sync for the objects you want to filter (this article).
- Run StoreConnect Setup.
The 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.
If 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.
:::warning
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.
:::
How it works
First, 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:
- Records with the value
enable_syncare included in synchronization - Records with any other value, or no value, are excluded
If 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.
Each object is filtered separately
The 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.
Two things follow from this:
- 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.
- 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.
So 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.
Example: keeping an order out of the sync
An Order and its Order Items are two separate standard objects, so each one needs its own StoreConnect Sync field.
| What you configure | What syncs |
|---|---|
| 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 |
| Field on Order and Order Item, neither opted in | Both the order and its line items are excluded |
| Field on Order and Order Item, order opted in but items not | The order syncs with no line items |
| Field on Order and Order Item, both opted in | The order and its line items sync |
The same rule applies to any other parent and child pair on standard objects, including Account and Contact (see the warning in Step 2).
:::warning 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. :::
Decide how to treat existing records
Any 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:
- Identify which records you want to enable sync for
- Identify and remove any records you no longer need
Step 1: Add the StoreConnect_sync field
- In Salesforce, select the gear icon and select Setup.
- In the Quick Find box, search for Object Manager.
- Select the standard object you want to filter (for example, Contact).
- Select Fields & Relationships, then New.
-
Select Text as the field type and select Next.
:::note Picklist and text area field types are also supported if you prefer a controlled value set or need a longer field. :::
- Set the Field Label to
StoreConnect Syncand confirm the Field Name is automatically set toStoreConnect_Sync. - Complete the remaining field settings and select Save.
Once the field exists on the object, opt-in filtering is active immediately for all future sync events on that object.
Repeat 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.
:::note
If 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.
:::
Step 2: Enable sync on required records
For each record that you want to sync to StoreConnect, set the StoreConnect_Sync__c field value to enable_sync.
You can do this in bulk using:
- Data Loader — update records via CSV export and import
- Salesforce Flow — build a scheduled flow to set the value on matching records
- Reports and List Views — use inline editing or mass update tools
Records where the field is blank or set to any other value will not sync.
:::warning
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.
For Person Accounts, see Step 3 for how to automate this with a Flow. :::
Step 3: Keep Person Account and Contact fields in sync (Person Accounts only)
Because 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:
- In Salesforce Setup, open Flow Builder and create a new Record-Triggered Flow.
- Set the object to Account and the trigger to run when a record is Updated, optimized for Actions and Related Records.
- Add an entry condition: IsPersonAccount equals
True. - Add a second entry condition: StoreConnect Sync (
StoreConnect_Sync__c) Is Changed equalsTrue. - Add an Update Records action:
- Select Use the account’s Person Contact ID to find records (or relate to the Contact via
PersonContactId). - Set
StoreConnect_Sync__con the Contact to the value of{!$Record.StoreConnect_Sync__c}.
- Select Use the account’s Person Contact ID to find records (or relate to the Contact via
- Save and activate the flow.
Once 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.
Step 4: Auto-enable sync for store-created records (optional)
When 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.
Set 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:
- In Salesforce Setup, open Object Manager and select the object (for example, Contact).
- Select Fields & Relationships and open the StoreConnect Sync field.
- Select Edit.
-
In the Default Value field, enter the following formula:
IF($Permission.storeConnect_Sync, "enable_sync", null) - Save the field.
This 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.
Confirm the filter is working
- Set
StoreConnect_Sync__ctoenable_syncon one test record and save it. - Open 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.
- Save a record on the same object with the field blank, and confirm the SC Row Count does not change.
When the sync value changes
StoreConnect handles transitions automatically when the StoreConnect_Sync__c value is updated on a record:
| Previous value | New value | What happens |
|---|---|---|
Not enable_sync |
enable_sync |
Record is sent to StoreConnect as a full insert |
enable_sync |
Not enable_sync |
Record is removed from StoreConnect |
enable_sync |
enable_sync |
Normal update sync, only changed fields are sent |
Not enable_sync |
Not enable_sync |
No sync event generated |
This 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.
Disable sync on a record
To 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.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.