The Offline Database object's Conditions is used to define the filters that will be applyed to the data before synchronizing with the devices.

Conditions are applyed to the Extended Table in order to guarantee the data consitency in the Offline Database. This is because each condition is independent and GeneXus has the intelligence to determinate in which tables the filters need to be applied. The criteria of this is: if the condition is evaluable in the extended table of some table, then the filter will be applied. This allows the developers not worry about the referential integrity of the data that will be stored in the device.

For example, by writing the following condition:

CustomerStatus = CustomerStatus.Active;

...will filter the Customers table by active customers, but will also filter the PurchasesOrders table (were the Customer is a foreign key) to allow only purchase orders from active customers. By doing this, there won't be PurchaseOrders in the device's database without corresponding Customer.

In the Offline Database Object Navigation Report it is shown how the conditions are applied for each table that is going to be synchronized to the device.

Example

Total filtering (no records in a specific table in the device)

In some cases, we may need to have a table in the local database because the application saves data to that table, but we don't want to bring any record from the server.
In that case, one possible solution is to define a condition that will never evaluate to True. 
For example, if we don't want to receive any Purchase Order in the device, the following condition could be used:

PurchaseOrderID < 0;

Availability

This feature is available as of GeneXus Tilo Beta 2

See also