User Guide: SDKs > VoltMX Iris SDK > Invoking an Object Service > OnlineObjectService Class
OnlineObjectService Class
Provides methods that perform operations acting on the Volt MX Foundry endpoint, including basic CRUD, metadata, and binary-related functions. An instance of OnlineObjectService is returned by the getObjectService Method when the second parameter specifies {“access”:”online”}.
Methods
The following methods are used by the OnlineObjectService class and its instantiations.
create Method
Creates an object in the Volt MX Foundry endpoint.
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 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 in the Volt MX Foundry endpoint.
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 in the Volt MX Foundry endpoint.
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
customVerb Method
Performs a custom operation on an object in the Volt MX Foundry endpoint.
Syntax
Parameters
Parameter | Description |
---|---|
verbName | Name of the custom verb defined in the Volt MX Foundry console |
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 |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
fetch Method
Fetches an object from the server.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which must be an instance of the voltmx.sdk.dto.DataObject Class. This instance must have the property selectQueryObject, which is an instance of voltmx.sdk.dto.SelectQuery, in order to fetch records based on the given criteria. |
successCallback | Function invoked when the method succeeds, with the number of records fetched |
failureCallback | Function invoked when fetch fails, with cause of failure |
Example
getMetadataOfAllObjects Method
Gets the metadata associated with the objects defined in the service from the server.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the optional parameter “getFromServer” |
successCallback | Function invoked when the operation succeeds |
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 server.
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 gotten |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
Parameter | Description |
---|---|
options (Refer the Options below) | JSON object with the mandatory parameter dataObject, which is an instance of the voltmx.sdk.dto.DataObject Class, |
fileDownloadStartedCallback | Callback to be invoked after file download start, this callback is optional. |
chunkDownloadCompletedCallback | callback invoked after each successful chunk download, this is invoked only when streaming is true. This callback is mandatory if streaming is true. |
fileDownloadCompletedCallback | Callback invoked after successful file download, with the file path. This is manditory if streaming is false. |
downloadFailureCallback | Callback invoked in case of download failure. |
Key | Value | Mandatory | Default Value |
dataObject | Instance of voltmx.sdk.dto.DataObject | Yes | - |
streaming | Boolean flag to determine whether the data needed to be given to chunks or a file after download. | No | false |
queryParams | provision for user to specify additional query params that need to be sent in the download call. | No | null |
headers | Provision for sending custom headers | No | null |
Parameter | Description |
---|---|
options (Refer the Options below) | JSON object with the mandatory parameter dataObject, which is an instance of the voltmx.sdk.dto.DataObject Class, |
binaryAttributeName | Binary field name in the object. |
fileDownloadStartedCallback | Callback to be invoked after file download start, this callback is optional. |
chunkDownloadCompletedCallback | callback invoked after each successful chunk download, this is invoked only when streaming is true. This callback is mandatory if streaming is true. |
fileDownloadCompletedCallback | Callback invoked after successful file download, with the file path. This is manditory if streaming is false. |
downloadFailureCallback | Callback invoked in case of download failure. |
Key | Value | Mandatory | Default Value |
dataObject | Instance of voltmx.sdk.dto.DataObject | Yes | - |
streaming | Boolean flag to determine whether the data needed to be given to chunks or a file after download. | No | false |
queryParams | provision for user to specify additional query params that need to be sent in the download call. | No | null |
headers | Provision for sending custom headers | No | null |
getBinaryContent Method
Gets binary content on the server.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which is an instance of the voltmx.sdk.dto.DataObject Class, and “binaryAttrName”, which is the binary field name in the object |
successCallback | Function invoked when the operation succeeds, with the number of records gotten |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
createBinaryContent Method
Creates binary content on the server.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which is an instance of the voltmx.sdk.dto.DataObject Class, and “binaryAttrName”, which is the binary field name in the object |
successCallback | Function invoked when the operation succeeds, with the number of records created |
failureCallback | Function invoked when the operation fails, with cause of failure |
Example
updateBinaryContent Method
Updates binary content on the server.
Syntax
Parameters
Parameter | Description |
---|---|
options | JSON object with the mandatory parameter “dataObject”, which is an instance of the voltmx.sdk.dto.DataObject Class, and “binaryAttrName”, which is the binary field name in the object |
successCallback | Function invoked when the operation succeeds, with the number of records updated |
failureCallback | Function invoked when the operation fails, with cause of failure |