Skip to main content
Version: 8.0

SyncOptions property

Level: advanced

Describes the options for configuring data synchronization. Contains the configuration object with properties presented in table.

Configuration object properties for the synchronization setup

ImportPageSize

The number of pages imported in the same thread.

PagesInImportTransaction

The number of import threads.

SysSettingsImportConfig

Imported system settings array.

SysLookupsImportConfig

Imported system lookups array.

ModelDataImportConfig

An array of models that will load the data during synchronization.

In the ModelDataImportConfig model array, you can specify additional synchronization parameters, the list of available columns and filter conditions for each model. If you need to load a full model during synchronization, specify the object with the model name in the array. If the model needs to apply additional conditions for synchronization, the configuration object with properties given in table is added to the ModelDataImportConfig array.

Configuration object properties for the synchronization model setup

Name

Model name (see Models property of the manifest configuration object).

SyncColumns

The column models array for which data is imported. In addition to the listed columns, the system columns (CreatedOn, CreatedBy, ModifiedOn, ModifiedBy) and primary displayed columns will also be imported during synchronization.

SyncFilter

The filter applied to the model during import.

The SyncFilter is applied to the model during import is a configuration object with properties given in table.

Filter model configuration object properties

type

Filter type. Set by the enumeration value Terrasoft.FilterTypes. Optional property. By default Terrasoft.FilterTypes.Simple.

Available values (Terrasoft.FilterTypes)

Simple

filter with one condition

Group

group filter with multiple conditions

logicalOperation

The logical operation for combining a collection of filters (for filters with Terrasoft.FilterTypes.Group type). Set by the enumeration value Terrasoft.FilterLogicalOperations. By default - Terrasoft.FilterLogicalOperations.And.

Available values (Terrasoft.FilterLogicalOperations)

Or

logical operation OR

And

logical operation AND

subfilters

A collection of filters applied to a model. Obligatory property for the filter type Terrasoft.FilterTypes.Group. The filters are interconnected by the logical operation set in the logicalOperation property. Each filter is a configuration filter object.

property

Filtered column model name. Obligatory property for the filter type Terrasoft.FilterTypes.Simple.

valueIsMacrosType

The checkbox that defines whether the filtered value is a macro. Optional property can be: true if the filter uses a macro, and false if it doesn't.

value

Value of the column filtration set in the property property. Obligatory property for the filter type Terrasoft.FilterTypes.Simple. Can be set directly by the filter value (including null) or a macro (the valueIsMacrosType property must be set to true). Macros that can be used as the property value are contained in the Terrasoft.ValueMacros enumeration.

Available values (Terrasoft.ValueMacros)

CurrentUserContactId

current user ID

CurrentDate

current date

CurrentDateTime

current date and time

CurrentDateEnd

current date end

CurrentUserContactName

current contact name

CurrentUserContact

current contact name and ID

SysSettings

system setting value. The system setting name is included in the macrosParams property

CurrentTime

current time

CurrentUserAccount

current account name and ID

GenerateUId

generated ID

macrosParams

Values transitioned to macros as parameters. Optional property. This property is now used only for the Terrasoft.ValueMacros.SysSettings macro.

isNot

Applied to the negation operator filter. Optional property. Takes the true value if the the negation operator is applied to the filter, otherwise – false.

funcType

Function type applied to the model column set in the property property. Optional property. Takes values from the Terrasoft.FilterFunctions enumeration. Argument values for the filtration functions are set in the funcArgs property. The value to compare the result of the function is specified by the value property.

Available values (Terrasoft.FilterFunctions)

SubStringOf

determines whether the string passed in as an argument is a substring of the property column

ToUpper

changes the column value set in the property to uppercase

EndsWith

checks whether the value in the property column ends with the value set as an argument

StartsWith

checks if the value of the property column starts with the value set as an argument

Year

returns the year value according to the property column

Month

returns the month value according to the property column

Day

returns the day value according to the property column

In

checks the occurrence of the value of the column property in the range of values that is passed as argument to the function

NotIn

checks for the absence of the value of the column property in the range of values that is passed as an argument to the function

Like

determines whether the value of the column property with the specified template

funcArgs

An array of argument values for the function filter defined in the funcType property. The order of the values in the array funcArgs must match the order of parameters of the funcType function.

name

The name of a filter or group of filters. Optional property.

modelName

Filtered model name. Optional property Specifies whether the filtering is performed by the columns of the connected model.

assocProperty

Connected model column by which the main model is connected. The primary column serves as a connecting column of the main model.

operation

Filtration operation type. Optional parameter. Takes values from the Terrasoft.FilterOperation enumeration. By default – Terrasoft.FilterOperation.General.

Available values (Terrasoft.FilterOperation)

General

standard filtration

Any

filtration by the exists filter

compareType

Filter comparison operation type. Optional parameter. Takes values from the Terrasoft.ComparisonType enumeration. By default – Terrasoft.ComparisonType.Equal.

Available values (Terrasoft.ComparisonType)

Equal

equal

LessOrEqual

less or equal

NotEqual

not equal

Greater

greater

GreaterOrEqual

greater or equal

Less

less

SyncOptions.ModelDataImportConfig.QueryFilter property

Available in the application starting with version 7.12.1 and in the mobile application starting with version 7.12.3.

The QueryFilter synchronization property enables to configure data filtering of the specific model when importing via the DataService service. Previously, the SyncFilter property was used to filter data and the import was performed via the OData service.

Important

Data import via the DataService service is available only for the Android and iOS platforms. The OData is used for the Windows platform.

The QueryFilter filter is a set of parameters in the form of JSON object that are sent in the request to the DataService service.

Example of the exists filter
{
"SyncOptions": {
"ModelDataImportConfig": [
{
"Name": "ActivityParticipant",
"QueryFilter": {
"logicalOperation": 0,
"filterType": 6,
"rootSchemaName": "ActivityParticipant",
"items": {
"ActivityFilter": {
"filterType": 5,
"leftExpression": {
"expressionType": 0,
"columnPath": "Activity.[ActivityParticipant:Activity].Id"
},
"subFilters": {
"logicalOperation": 0,
"filterType": 6,
"rootSchemaName": "ActivityParticipant",
"items": {
"ParticipantFilter":{
"filterType": 1,
"comparisonType": 3,
"leftExpression": {
"expressionType": 0,
"columnPath": "Participant"
},
"rightExpression": {
"expressionType": 1,
"functionType": 1,
"macrosType": 2
}
}
}
}
}
}
}
}
]
}
}