La APP offline de flexygo, por defecto, envía todos los registros de aquellas tablas que tengan alguno de los bits de cambio activo, como indican los campos de las tablas _isInserted, _isDeleted, _isUpdated. Y cuando se hace un refresco de los datos, éste se realiza para todo el modelo.


En ocasiones puede ser necesario realizar un envío o recepción de datos personalizado, o sea, indicar específicamente qué tablas quiero sincronizar en un momento dado.

Para eso, hay que crear una función js como indica cualquiera de las funciones y ejemplos descritos a continuación.



Get data from server without overwrite modified rows.
  • {boolean} reloadPage
  • {string} jscode
  • {SyncOptions} options
    • {boolean} partialSync?: If true only get tables and views in syncTables and syncViews array
    • {Array<string>} syncTables?: List of tables to get
    • {Array<string>} syncViews: List of views to get
    • {boolean} partialSend?: If true only send tables and views in syncTables and syncViews array
    • {Array<string>} sendTables?: List of tables to send
    • {Array<string>} sendViews?: List of views to send


flexygo.sync.syncData(reloadPage,jscode, options);


EJEMPLO

Se realiza una sincronización parcial únicamente de las tablas Partes, Conf_Partes, Clientes_Datos y Contactos

Recibir = async function(){

    let opts = {
      partialSync: true,
      syncTables: [],
      syncViews: []
    };

    opts.syncTables.push('Partes');

    opts.syncTables.push('Conf_Partes');

    opts.syncTables.push('Clientes_Datos');

    opts.syncTables.push('Contactos');
   
    flexygo.sync.syncData(true, "",opts);

  }



Get data from server overwriting modified rows.
  • {boolean} reloadPage
  • {string} jscode
  • {SyncOptions} options
  • {boolean} partialSync?: If true only get tables and views in syncTables and syncViews array
  • {Array<string>} syncTables?: List of tables to get
  • {Array<string>} syncViews: List of views to get
  • {boolean} partialSend?: If true only send tables and views in syncTables and syncViews array
  • {Array<string>} sendTables?: List of tables to send
  • {Array<string>} sendViews?: List of views to send


flexygo.sync.overwriteData(reloadPage,jscode, options);



Sends modified rows to server.
  • {SyncOptions} options
  • {boolean} partialSync?: If true only get tables and views in syncTables and syncViews array
  • {Array<string>} syncTables?: List of tables to get
  • {Array<string>} syncViews: List of views to get
  • {boolean} partialSend?: If true only send tables and views in syncTables and syncViews array
  • {Array<string>} sendTables?: List of tables to send
  • {Array<string>} sendViews?: List of views to send



flexygo.sync.sendData(options);