Schedule and Automate Staged Sync Jobs
Staged sync data pre-packages offline lookup entities and schema layouts into static snapshot records (FX5__Staged_Data__c). This background process runs asynchronously via scheduled Apex under a designated administrative user.
|
Assigning the running user and scheduling the background task are executed in two distinct steps to ensure the running user assignment is committed to the platform event subscriber context before the Apex job is initiated. For FX5 versions 1.734 and later, reassignment automatically removes the old user’s scheduled job to prevent duplicate or conflicting background tasks. |
|
If you change the data type of a field within a look-up object (for example, changing a field from Number to Text), you must manually run the Prepare Sync Data job in the Sync Profile Manager for all affected sync profiles. This ensures the staged data is regenerated with the correct metadata so the FieldFX Mobile App recognizes the updated data type. |
Prerequisites
-
Assign the required permissions to the user who runs the staged sync job
-
Delete the existing scheduled job before rescheduling it when required by a recovery procedure
-
For FX5 versions 1.734 and later, reassignment automatically removes the previous user’s scheduled job; manual deletion is not required before reassigning the staged sync job user
Because staged data is generated from live Salesforce data, the results depend on the permissions and access of the user who runs the generation process. Use the following guidance to help ensure staging includes the required records, fields, and FieldFX processing access.
If the run-as user can access some Accounts but not others, only the accessible Accounts are included in staged data. The mobile app might therefore receive an incomplete set of customer records during sync.
-
Run staged data generation as a dedicated administrator user with broad read access to the required objects and fields.
Because the Bulk API respects object permissions, field-level security, and sharing, missing access can produce incomplete staged data.
Example 2. Run-as user missing accessIf the run-as user cannot read a lookup object or a required field, that data might be omitted from the generated digest.
-
Make sure the run-as user also has the required FieldFX permission sets and access to the Apex classes used for staging and sync.
Example 3. User with Salesforce read access but without FieldFX processing accessA user with Salesforce read access but without the necessary FieldFX processing access might be able to view records but still be unable to generate or refresh staged data correctly.
Procedure
-
In the Salesforce BackOffice, open Sync Profile Manager (ASPE).
-
In the sync profiles table, locate the target profile, open the row actions menu, and select Stage Sync Data.
-
Click Assign Staged Sync Job User (or Configure Staged Sync Job User).
-
In the modal, select the administrator account designated to execute staging batches and confirm.
Wait for the assignment to process. The screen reloads once the running user is successfully registered.
If ASPE indicates that the Platform Event and Scheduled Task running users do not match, suspend and resume the
SyncStagingRequestTriggerPlatform Event subscriber in Salesforce Setup before continuing. -
Click Schedule Staged Sync Job.
-
Verify that the page updates to display the scheduled job details.
Verification
-
Go to Salesforce Setup > Environments > Jobs > Scheduled Jobs and confirm the
FX5.SyncStagedDatajob is listed with the designated administrator as the submitter. -
Go to Salesforce Setup > Integrations > Platform Events and confirm the subscriber displays the assigned administrator rather than the automated system process.