Delete
method is used to delete a message. It is available only in synchronous mode.
The following is an example for using Delete
:
Synchronous
messaging_handle.call('Delete', {'MessageId': message_id})
The following table summarizes the specification of Delete
:
Interface | IMessaging |
Description | Delete deletes the message. |
Response Model | Synchronous |
Pre-condition | Valid instance of IMessaging interface is instantiated. |
Post-condition | Message no more exists in database. |
Input Parameters
Input parameter specifies the MessageId
of the message to delete.
|
Output Parameters
Output parameters contain ErrorCode
, and ErrorMessage
if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to delete a particular SMS:
import scriptext import appuifw import e32 lock = e32.Ao_lock() sms_iter = None messaging_handle = scriptext.load('Service.Messaging', 'IMessaging') sms_iter = messaging_handle.call('GetList', {'Type': u'Inbox'}) id_list = [] body_list = [] for sms_dict in sms_iter: if sms_dict['MessageType'] == 'SMS': id_list.append(sms_dict['MessageId']) body_list.append(sms_dict['BodyText']) # Select the message to be deleted message_index = appuifw.selection_list(body_list) try: messaging_handle.call('Delete', {'MessageId': id_list[message_index]}) except scriptext.ScriptextError, err: print "Error deleting SMS :", err else: print "Message deleted successfully"
See About this document... for information on suggesting changes.