Flexible Sync allows users to define in detail which information they want to be available in the Axsy Retail Execution Mobile App for offline use. The process to configure offline sync settings is made simple with Axsy's Config UI, with settings configured through clicks, not code.



Covered in this article are the following Flexible Sync setup components illustrated above: 

  1. Navigate to the Sync Menu
  2. Configure Settings for Record Sets 
  3. Choose a Scope  
  4. Publishing Flex Sync Settings 


This article covers the Axsy Flexible Sync Config settings. Users can also configure settings for Global Config features in this area by using similar methods covered in this article. 


Navigate to the Axsy Retail Execution Web App on Salesforce


Navigate to the Settings tab of the Axsy Retail Execution Web App on the Salesforce Platform. To the left-hand side you will see a list of customisable features and settings. To configure Flexible Sync, select the Sync tab. 



Record Sets


Record Sets are a way in which to define in detail what, how, and when data should be synced to the Axsy Retail Execution Mobile App for offline use. Each Record Set defines the sync conditions of an Object (SObject) and optionally other Objects related to it. 


Query Parameters 


The Query Parameters tab holds general parameters about how the sync of a Record Set will be handles by the app. Common across all Record Sets is a numeric input field for How often to check for updates in Salesforce (minutes)For the Visits and Previous Orders Objects, additional numeric input fields can be set to implement limitations on the volume of record synced to the app. 



The Axsy Retail Execution Mobile App can be configured to check for Visit updates every 60 minutes, while Price Books changes may only need to be updated once-a-day.


Query Details 


The Query Details tab of a Record Set is where you can refine what data for the Object is synced to the app by either creating a set of SOQL-based conditions, or selecting a List View for the Object created on the Salesforce Platform. 


Query Chain 


A Query Chain contains one or more queries that can be ordered in a way to retrieve specific results for more complex data queries. The order that is defined here is the order that the app processes the queries, and so the output of one query can be used as the data source for another. Select Reorder to make changes to the order of the queries in the Chain.



The Query Chain Name above is 'Previous Orders'. It has two different queries that can be configured by the methods covered below.


Filter Tool 


The Filter Tool is a way to create one or more conditions for the query. Once created, Filter Logic can then be applied to the conditions to determine how they will be combined during the app's initial sync. 


1. Select the Filter button under the Query Details tab for a Record Set, and then select Add Condition



2. Select the Field, Operator and Value to create the logic for your condition and then select Done.



3. The conditions will be formatted with SOQL-style syntax and API Field Names inserted. You can then organise the way in which the filters will be implemented by creating Filter Logic. 



All filters must be a part of the Filter Logic. Otherwise, an error message will appear that will prevent changes from being saved.  


List Views 


Alternatively, a Salesforce List View can be used as a means by which to filter the data being synced to the Axsy Retail Execution Mobile App. 


Select the List Views button under the Query Details tab for a Record Set and select a List View. 



For more information on how to create a List View, please see this Salesforce Trailhead: Create and Customize List Views


Related Object Tree 


In order to customise the syncing scope of Objects, the Object Tree is a visual hierarchy of the syncing depth which can be customised so that you can remove and add Related Objects for each Record Set, targeting relevant data.


1. Select the pencil icon next to an Object to customise it.



2. Select which Related Objects you would like to be synced for offline access for an Object in the Tree.



All Fields for the Object will be automatically synced for offline access. For example, the Account's Contact field will be synced, however, in order to view the Details for that Contact offline, the Contacts Related Object needs to be selected (as shown above).


To ensure that key app functionality cannot be broken, there are some mandatory Objects that cannot be de-selected when editing Object hierarchy.


3. Once selected, the Object will appear in the Object Tree and will also be available for configuration. 



Each object has an icon indicating whether there is a 1 to 1 relationship (a single horizontal line) or a 1 to many relationship (three horizontal lines) to its Parent Object in the tree.


4. To enable Chatter Feed and Actions for an Object, edit the Object and select the General tab to select the relevant checkboxes. 



Create a New Record Set 


You can create Record Sets for any Standard or Custom Object in your Org. 


1. To create a new Record Set for an Object, select the New button on the side menu. 



2. Select the SObject that you would like to configure and enter a Name for the Record Set. Save your changes.



Choose a Scope 


Once you are happy with your settings, you can choose which users can access these new settings before publishing a new version of the configuration. 


1. To customise the user scope, click the Manage Scopes button to the right-hand corner. 



2. Select Create Scope. You can either clone an existing Scope and its settings, or, set it to Default Values. The Default Values settings are the settings that come with the Managed Package and are what you see in the first ever version of the Flex Sync Settings (created automatically on Managed Package installation).



3. Give the scope a Name and define the Scope with the fields below. You can set the scope to be the Org Default, applicable to certain Profiles and/or applicable to certain Users



Here, the Sales Rep Scope defined above means that only users with the Sales Profile will receive the new configuration when it is published (see next step below). 


4. Select the drop-down arrow at the top left-hand corner of the Axsy Config UI and select a scope of users. 



Publish Your Changes


When you publish a new offline configuration version, a new set of metadata is created that tells the app what information to retrieve and then sync at login on the Axsy Retail Execution Mobile App. The metadata file is essentially a snapshot of the Flexible Sync Settings and other Org Settings & Metadata at the time of publishing. This means that changes made on the Salesforce Platform will only be implemented when a new version of Flexible Sync is published. 


Any changes made to your Flex Sync settings before being published are saved as a Draft. To implement changes to a version already published, you need to publish a new version. 


1. Once you have saved your changes, select the green Publish button to the top right-hand corner of the screen. 



2. Add any notes if needed and click Publish