Skip to content

Configure automated sync jobs to keep your Salesforce data current with Onboarded™.

Important: Batch jobs run as the user who schedules them. Ensure this user has the Onboarded™ Admin permission set and access to all objects/fields being synchronized. See the Execution Context page for details.

Scheduled Sync Setup

Setup UI Method

  1. Open Onboarded™ Setup. Navigate to the Onboarded™ Setup tab.
  2. Go to Scheduled Jobs Tab. Click on the Scheduled Jobs section.
  3. Configure Schedule. Set your preferred schedule using the CRON expression builder or presets.
  4. Save and Enable. Save your configuration and enable the scheduled job.

Alternative — Manual Scheduling via Setup. You can also schedule jobs manually from Setup → Apex Classes → Schedule Apex. If you use this method, the Onboarded™ Setup UI will still detect the scheduled job and update accordingly, as long as the job name starts with "Onboarded" (e.g., "OnboardedSyncScheduler"). Jobs scheduled with other names will run but won't be reflected in the Onboarded™ Setup interface.

Apex Method

Schedule Daily at 2 AM

// Schedule default daily sync at 2:00 AM
OnboardedSyncScheduler.scheduleDaily();

Custom CRON Schedule

// Schedule every 4 hours
OnboardedSyncScheduler.scheduleWithCron('0 0 0,4,8,12,16,20 * * ?');

// Schedule weekdays at 6 AM
OnboardedSyncScheduler.scheduleWithCron('0 0 6 ? * MON-FRI');

View Active Schedules

// List all scheduled Onboarded jobs
List<CronTrigger> jobs = OnboardedSyncScheduler.getScheduledJobs();
for (CronTrigger job : jobs) {
    System.debug(job.CronJobDetail.Name + ' - Next: ' + job.NextFireTime);
}

Remove All Schedules

// Unschedule all Onboarded sync jobs
OnboardedSyncScheduler.unscheduleAll();

Important — Scheduled Jobs Run As The Scheduling User. Salesforce scheduled jobs execute in the security context of the user who scheduled them. This affects CRUD/FLS permissions, sharing rules, and record access.

Best practices:

  • Schedule jobs using an integration user or system administrator account with appropriate data access
  • Avoid scheduling under individual user accounts that may be deactivated — deactivating the scheduling user will cause the job to fail
  • If the scheduling user leaves the organization, reassign or reschedule the job under an active admin account

Common CRON Expressions

ScheduleCRON Expression
Daily at 2:00 AM0 0 2 * * ?
Every 6 hours0 0 0,6,12,18 * * ?
Weekdays at 7:00 AM0 0 7 ? * MON-FRI
Every hour0 0 * * * ?
Sunday at midnight0 0 0 ? * SUN

Batch Size Configuration

The Batch Size setting controls how many records are processed in each batch execution during sync operations. This setting is configurable in the Onboarded™ Setup interface.

SettingDetails
Valid Range1 to 2000 records per batch
Default Value200 records

Batch Size Tuning

  • Decrease batch size if you encounter governor limit errors (CPU time, heap size, SOQL queries) due to complex triggers, validation rules, or automation on the target objects
  • Increase batch size if sync operations are taking too long and you have minimal automation on target objects

Tip: Start with the default value of 200. If you experience governor limit issues, try reducing to 100 or 50. Only increase above 200 if you have tested thoroughly and confirmed your org can handle larger batches.

Batch Sync Exemption Rules

Batch Sync Exemption Rules allow you to exclude specific records from being synced based on field values in the Onboarded™ API response. This is useful when you want to filter out certain records before they are created or updated in Salesforce.

Exemption Rule Mechanics

When a sync batch runs, API records are checked against active exemption rules before being processed. Records that match any active exemption rule are excluded from the sync operation.

Exemption Rule Creation

Exemption rules can be configured in the Onboarded™ Setup interface. Each rule requires:

FieldDescription
Onboarded™ ObjectThe Onboarded™ object type this rule applies to (e.g., Employee, Employer, Task)
Onboarded™ API FieldThe API field name to evaluate. Supports nested fields using dot notation (e.g., status, address.city)
Match TypeHow to evaluate the field value (see match types below)
Exemption ValueThe value to match against (required for "equals" match type)
Is ActiveToggle to enable or disable the rule

Match Types

Match TypeDescriptionExample Use Case
equalsField value exactly matches the exemption valueExclude employees where status equals terminated
isBlankField value is null, empty, or whitespaceExclude records where email is blank
isNotBlankField value is not null and not emptyExclude records that have a do_not_sync flag populated

Example Exemption Rules

  • Exclude terminated employees: Onboarded™ Object = Employee, API Field = status, Match Type = equals, Value = terminated
  • Exclude test records: Onboarded™ Object = Employee, API Field = email, Match Type = equals, Value = test@example.com
  • Exclude records without email: Onboarded™ Object = Employee, API Field = email, Match Type = isBlank

Note: Exempted records are counted in sync statistics but are not created or updated in Salesforce. If an exemption rule is later deactivated or removed, previously exempted records will be synced on the next batch run.