Description:
The Delete method deletes an event (entry) from
the event log database.
This method can be called both synchronously and asynchronously.
Syntax:
For synchronous calls:
Delete(parameters:Object):Object
For asynchronous calls:
Delete(parameters:Object, callback:Object):Object
Arguments:
parameters:
This is an object that specifies which event to delete from the log event database. For more information about the object properties and how to define them, see section Parameters for deleting an event.
callback:
The callback argument is the name of the method
that is executed when an asynchronous Delete call has
results or status information to return. You must define this method separately.
Follow the instructions in section Defining the callback handler for an asynchronous method to
define the callback method.
This argument is used only with an asynchronous Delete call.
Return value:
If synchronous, the Delete method returns an error
code and an error message.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
If asynchronous, the method returns an object that contains a transaction
ID for the callback instance,
an error code, and an error message (see the following table). When the asynchronous
call has completed, callback returns an object that contains
an error code and an error message (see Table:
Callback return value).
|
Property |
Description |
Value |
|---|---|---|
|
|
This is a number used as an identification to match transactions started
with the asynchronous This property is only valid for asynchronous calls. |
|
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
Example code:
The following sample code illustrates how to delete an event synchronously:
import com.nokia.lib.Service;
var logging = new Service("Service.Logging", "IDataSource");
var inputData = {id:logid}; // must be a valid logid which is a String
var inParams = {Type:"Log", Data:inputData};
var outParams = logging.Delete(inParams);
var errorId = outParams.ErrorCode;
The following sample code illustrates how to delete an event asynchronously:
import com.nokia.lib.Service;
var logging = new Service("Service.Logging", "IDataSource");
var inputData = {id:logid};// must be a valid logid which is a String
var inParams = {Type:"Log", Data:inputData};
logging.Delete(inParams,onDelete);
function onDelete (transactionID:Number, eventID:String, outParam:Object) {
var errorcode = outParam.ErrorCode;
}