DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR
Return Types
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
createOfflineDataDescription()
Create a descriptive model for offline data.
createOfflineDataDescription(prefix)
Create a descriptive model for offline data.
getRowDescriptions(fs, pks)
This method returns the description of rows as a json array object.
void
performSync(data, version, authenticateResult)
If all the changes for a mobile client needs to come as once so that they can be in 1 transaction.
{column:width=100%|padding=0px}{column}
Method Details
createOfflineDataDescription
()
Sample
//plugins.mobile.getOfflineFoundSetData(foundset,null); var data = plugins.mobileservice.createOfflineDataDescription('data_');
createOfflineDataDescription
(prefix)
Parameters
{String} prefix – specified formname prefix used to retrieve row data from REST wise
Sample
//plugins.mobile.getOfflineFoundSetData(foundset,null); var data = plugins.mobileservice.createOfflineDataDescription('data_');
getRowDescriptions
(fs, pks)
Parameters
{JSFoundSet} fs – the foundset
{Object[]} pks – the array of pks
Sample
/** @type {Array<Object>} */ var idsArray = new Array(100,200,300); foundset.loadAllRecords(); var json = plugins.mobileservice.getRowDescriptions(foundset, idsArray)
void
performSync
(data, version, authenticateResult)
Parameters
{Object} data – The data package that is given to the offline_data form ws_update method.
{Number} version – The version number that is given to the offline_data form ws_update method.
{Object} authenticateResult – The authenticateResult object that is given to the offline_data form ws_update method. (generated by the offline_data.ws_authenticate)
Returns
void
Sample
try { databaseManager.startTransaction(); plugins.mobileservice.performSync(data,version,authenticateResult); databaseManager.commitTransaction(); } catch (e) { databaseManager.rollbackTransaction(); // log the error and return false to that the mobile client will know the sync did fail. application.output(e,LOGGINGLEVEL.ERROR); return false; }