Official Content

Sends pending modifications from the local database to the server and synchronizes changes made via a Business Component.

Syntax

&SynchResult = Synchronization.Send()

Where:

SynchResult
Is a numeric variable. Stores the result of the send method.

Description

This method sends to the server the pending modifications made in the local database. All these modifications are stored as events in the GxPendingEvents table in the device's local database.

Note: Only changes made via a Business Component are sent to the server.

Once the Send process ends, all pending events that have been successfully applied on the server are removed from the GxPendingEvents table. On the other hand, all events that could not be applied on the server remain in the GxPendingEvents table, and their status is changed to "RejectedServer".
The SynchronizationEvents external object has methods to query the pending events as well as any synchronization error.

Type returned

Returns one of the following values:

Send message code Send message Send message causes
0 Send OK. Data has been successfully sent.
1 Error opening Transactions. An error has occurred while opening the Transactions.
2 Unknown error. Unknown error.
3 Replicator not found. The application could not find the replicator services. Try checking if the Services URL property is correct or test if the replicator services are correctly published.
8 Send is already running The replicator will not be executed because another send is already running.

Note: If you are invoking the Send method directly, avoid using the Send Changes property = When connected simultaneously.

Sample

Here is an example of calling the Send method when pressing a button:

Event "MyAction"
    &SynchResult = Synchronization.Send()
EndEvent

Scope

Object:   Objects for Native Mobile applications development
Generator:  Android, Apple

Availability

As from GeneXus X Evolution 3.

See Also

Synchronization.Receive method
Synchronization.ServerStatus method
Synchronization API
SynchronizationEvents external object

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant