Auto Sync

Introduction

Auto Sync is a streamlined update to the Sync V4 process.

Field user’s devices already automatically download data from the back office at intervals that vary by object. Auto Sync allows for a full two-way sync by automating the uploading of data to the back office, too.

Rather than relying on users to manually sync during the day or at the end of their work shift, Auto Sync uses an available Internet connection to automatically perform a sync from FieldFX Mobile every few minutes.

Admins can troubleshoot any sync packet issues with the Admin Portal’s tool for Auto Sync, the Sync Event Viewer.

In the event there is a Sync Upload Error, admins can use the Packet Viewer in the Audit Log.

Prerequisites

To use Sync 4.0, you need to:

Have these user licenses Have these permissions Complete these tasks
and review these topics
before continuing

Benefits

  • Back Office users can receive updates on the progress of field jobs as they happen, as long as the field user has an available Internet connection.

  • Lower the risk of data transfer delay or loss when a field user does not sync their device as expected.

  • Large upload sizes are reduced, limiting the instances of long syncs as long as the mobile users have network access.

  • Auto Sync is multi-threaded, rather than relying on one queue for all sync requests.

  • One failed event does not hold up subsequent events.

How it Works

Data Uploading

Data Upload Auto Sync must be activated.

  1. When a FieldFX Mobile user makes a change, the field device automatically initiates the sync process as soon as the change is complete.

    FieldFX Mobile waits three seconds after a user completes one change in case they also make another change.

    If a field user does not have an available Internet connection, the changes are stored until a connection becomes available. Queued changes automatically upload when a connection is reestablished.

  2. Events in the sync load to the FX5__Sync_Events__c object from the mobile device.

  3. Apex code runs to process the events, marking successfully synced events for deletion.

    The code processes the events according to the size of each event:

    1. For events under the batch size, events process synchronously

    2. For events over the batch size, events process asynchronously using the batching API from Salesforce

  4. A nightly process removes events marked for deletion.

    The FX5__SyncEventKeptHistoryInDays__c custom setting controls how long to keep events marked for deletion. The default is 40 days.

  5. Review failed events in the Sync Events Viewer in the Admin Portal (admin.fieldfx.com).

Data Downloading

  • Data downloads from FieldFX Back Office to a user’s device automatically at intervals that vary by object type.

    The download depends on the availability of an Internet connection.

  • During a download sync:

    1. The mobile device pulls down custom settings.

    2. The device checks to see if the metadata information has expired.

      Metadata includes information such as descriptions, layouts, compact layouts, search layouts, field sets, and so on.

      Expiration defaults to 24 hours (1440 minutes), and can be changed with the FX5__SyncMetadataCacheDurationMinutes__c FX Setting custom settings.

    3. If metadata is expired, the mobile device downloads configuration data.

    4. The device then downloads data for each object from back office to the mobile device based on the object’s sync interval.

      1. If there is a sync date for an object, an incremental sync is used for the object data.

      2. If there is not a sync date for an object, a full sync is used for the object data.

    5. Syncs file attachment bodies (headers come with the data).

    6. Syncs attachments (from Chatter or Files API based on org configuration).

Default Download Sync Intervals

  • The following default values are used for downloading object data:

    Object Interval
    (in minutes)
    Custom Setting API Name

    Configuration

    1440

    SyncInterval_Config_Minutes__c

    Lookups

    120

    SyncInterval_Lookups_Minutes__c

    Pricebooks

    120

    SyncInterval_Pricebooks_Minutes__c

    Quotes

    60

    SyncInterval_Quotes_Minutes__c

    Jobs

    60

    SyncInterval_Jobs_Minutes__c

    Tickets

    60

    SyncInterval_Tickets_Minutes__c

    FX Forms

    60

    SyncInterval_Fxforms_Minutes__c

    Files

    60

    SyncInterval_Files_Minutes__c

  • To customize the interval for an object, add a custom setting, copying the API Name for the object exactly as above.Enter the desired value in minutes.

  • To ignore an object for syncing purposes, add it to the FX5__Sync_ExcludedTypes__c custom setting in FX Settings.

Considerations

  • The org must enable attachments through the Files API, as Auto Sync relies on the Files API for the automatic syncing of data.

    Auto Sync does not use or support either Chatter or Notes & Attachments lists. All reports and files that sync do so through the Files API.

  • Field users must have an active and available Internet connection for data to sync. Offline data automatically syncs when an Internet connection becomes available.

Troubleshooting Failed Events

  • Failed events (and only failed events) can be reviewed in the Sync Event Viewer in the Admin Portal.

  • The Sync Event Viewer lists the event failures grouped by user.

  • Common reasons an event can fail include (but are not limited to):

    • Permissions

    • Validation Rules

    • Exceeded API limits

    • Missing or deleted data.

  • When an event fails, it can cause all the subsequent related events to fail as well.

    For instance, a create event for a Job or a Ticket fails for some reason.

    Any event that is dependent on the existence of that record also fails.

    If a Ticket fails to create, all of the ticket’s Items, Logs, Checklist Steps, Reports, and so on, also fail to create.

  • Events can fail if an associated record, like the Ticket for Ticket Item, was deleted by someone in back office.

    • If the record is still in the Salesforce Recycle Bin, the Sync Event Viewer displays a message stating that the object’s parent was deleted and attempts to provide a link directly to the item in the Recycle Bin so that the admin can restore or undelete the record.

    • Once the parent record has been restored, the event should be able to successfully reprocess.

  • Unneeded events can be ignored, then deleted, allowing for other events for a user to be preprocessed.

  • For more details on how to troubleshoot failed events, see the articles on the Sync Event Viewer Admin Portal tool.

  • Learn about resolving Sync Upload Errors using the Packet Viewer in the Audit Log.

Common Event Errors

Too Many DML Statements

  • This error indicates that too many triggers and process flows are writing data while Sync Events process.

  • To resolve this error, reduce the number of triggers and process flows.

  • Use 10 as a starting number for the size of the sync packets in the Sync Packet Size FX Setting.

    If you encounter any issues, reduce the number to 5.

Too Many SOQL Queries

  • This error indicates that too many triggers and process flows are querying data while Sync Events process.

    Declarative Lookup Rollup Summaries (DLRS) can cause this error.

  • To resolve this error, reduce the number of triggers and process flows.

  • Use 10 as a starting number. If you encounter any issues, reduce the number to 5.

  • As an alternative, reduce the size of the sync packets by setting the Sync Packet Size FX Setting to a smaller number.

    Reducing the value of the custom setting in half should address the error.