Official Content

The synchronization API makes it easier to call the generated synchronization programs for Offline applications in order to make the synchronization between the device and the web server whenever the developer wants to.

Methods

ServerStatus Determines the server status.
Receive Receives in the device all the changes made in the server.
Send Sends the pending modifications to the application server in order to submit the changes.
ResetOfflineDatabase

It returns the local database (offline) content to its initial state. That means:

  • restoring the preloaded database if it exists, or
  • executing a Create Database to empty database tables.
SetSendCheckpoint Set checkpoints in the pending events in order to allow batch synchronization 

Samples

Event ‘Do Receive’
    Synchronization.Receive()
EndEvent

Considerations

If using the Synchronization API make sure not to set the Data Receive Criteria property to the "Never" value, it could generate strange errors when using the API.

The UI could display the following error:

Synchronization.Send Error 3

Internally the error could be

{"error":{"code":"0","message":"Invalid Synchronizer SDOfflineDatabase"}}{"EventResults":[]}"}}

where SDOfflineDatabase refers to the associated Offline Database object.

Availability

SetSendCheckpoint method is available as from GeneXus 16 Upgrade 3.

See Also

HowTo: Use the Synchronization API

 

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