User Guide: SDKs > VoltMX Iris SDK > Invoking an Object Service > OfflineObjectService Class
OfflineObjectService Class
Provides methods that perform operations acting on the sync database, including basic CRUD, metadata, and binary-related functions. An instance of OfflineObjectService is returned by the getObjectService Method when the second parameter specifies {“access”:”offline”}.
Methods
The following methods are used by the OfflineObjectService class and its instantiations.
create Method
Creates an object offline in the sync database.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the following parameters: “dataObject” - a mandatory parameter which must be an instance of the voltmx.sdk.dto.DataObject Class “httpRequestOptions” an optional parameter used for configuring thin rich network calls. -or- ““xmlHttpRequestOptions” - an optional parameter used for configuring thin thin network calls. The possible values for these options are: “timeoutIntervalForRequest” - specifies the timeout interval. “timeoutIntervalForResource” - specifies the timeout interval. |
successCallback | Function invoked when the operation succeeds, with the primary key of the created object |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
Note: When using object services for SAP, the general norm is to have character field values stored in upper case. However, if you need to pass in mixed/lower case values for an SAP field, ensure that this field is designated as mixed case in the SAP Add-in LDB workbench.
update Method
Updates an object offline in the sync database (local store).
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which must be an instance of the voltmx.sdk.dto.DataObject Class |
successCallback | Function invoked when the operation succeeds, with the number of records updated |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
delete Method
Deletes an object offline in the sync database.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which must be an instance of the voltmx.sdk.dto.DataObject Class |
successCallback | Function invoked when the operation succeeds, with the number of records deleted |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
getMetadataOfAllObjects Method
Gets the metadata associated with the objects defined in the service from the local store.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the optional parameter “getFromServer” |
successCallback | Function invoked when the operation succeeds, with the number of records updated |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
getMetadataOfObject Method
Gets the metadata associated with an object defined in the service from the local store.
Syntax
Parameters
Parameter | Description |
---|---|
objectName | The name of the desired object as defined in the service |
options | JSON object with the optional parameter “getFromServer” |
successCallback | Function invoked when the operation succeeds, with the number of records returned |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
executeSelectQuery Method
Executes a Select query on the sync database.
Syntax
Parameters
Parameter | Description |
---|---|
queryString | SQL Select query string |
successCallback | Function invoked when the operation succeeds, with the number of records operated on |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
getBinaryContent Method
Gets binary content from the sync database.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which is an instance of the voltmx.sdk.dto.DataObject Class |
successCallback | Function invoked when the operation succeeds, with the number of records gotten |
failureCallback | Function invoked when the operation fails, with cause of failure |