Skip to main content
Version: 8.1

Load model data to the mobile app upon synchronization

Level: advanced
Example

During synchronization, the data for the following models has to be loaded into the mobile application:

  1. Activity - all columns are loaded. While the model is being filtered, only the activities with the current user listed as a participant are loaded.
  2. Activity type – a full model is loaded.

Example implementation

SyncOptions property
// Synchronization settings
"SyncOptions": {
// The number of pages imported in the same thread.
"ImportPageSize": 100,
// The number of import threads.
"PagesInImportTransaction": 5,
// Imported system settings array.
"SysSettingsImportConfig": [
"SchedulerDisplayTimingStart", "PrimaryCulture", "PrimaryCurrency", "MobileApplicationMode", "CollectMobileAppUsageStatistics", "CanCollectMobileUsageStatistics", "MobileAppUsageStatisticsEmail", "MobileAppUsageStatisticsStorePeriod", "MobileSectionsWithSearchOnly", "MobileShowMenuOnApplicationStart", "MobileAppCheckUpdatePeriod", "ShowMobileLocalNotifications", "UseMobileUIV2"
],
// Imported system lookups array.
"SysLookupsImportConfig": [
"ActivityCategory", "ActivityPriority", "ActivityResult", "ActivityResultCategory", "ActivityStatus", "ActivityType", "AddressType", "AnniversaryType", "InformationSource", "MobileApplicationMode", "OppContactInfluence", "OppContactLoyality", "OppContactRole", "OpportunityStage", "SupplyPaymentDelay", "SupplyPaymentState", "SupplyPaymentType"],
// An array of models that will load the data during synchronization.
"ModelDataImportConfig": [
// Activity model configuration.
{
"Name": "Activity",
// The filter applied to the model during import
"SyncFilter": {
// Filtered column model name.
"property": "Participant",
// Filtered model name.
"modelName": "ActivityParticipant",
// Connected model column by which the main model is connected.
"assocProperty": "Activity",
// Filtration operation type.
"operation": "Terrasoft.FilterOperations.Any",
// A macro is used for filtration.
"valueIsMacros": true,
// Column filtration value – current contact ID and name.
"value": "Terrasoft.ValueMacros.CurrentUserContact"
},
// The column models array for which data is imported.
"SyncColumns": [
"Title", "StartDate", "DueDate", "Status", "Result", "DetailedResult", "ActivityCategory", "Priority", "Owner", "Account", "Contact", "ShowInScheduler", "Author", "Type"
]
},
// The ActivityType model is loaded in full.
{
"Name": "ActivityType",
"SyncColumns": []
}
]
}