GetList()

Description:

The GetList method retrieves a list of messaging objects from the Messaging Center of the S60 device. Each object contains messaging information, that is, header and content data for a single message.

This is a synchronous method.

Syntax:

GetList(parameters:Object):Object

Arguments:

  • parameters:

    This is an object that specifies what messaging information is returned and how the returned information is sorted. For more information about the object properties and how to define them, see section Parameters for retrieving messaging information.

Return value:

The GetList method returns an object that contains the requested messaging information, an error code, and an error message.

Table: Return value properties for GetList

Property

Description

Value

ReturnValue

This is an iterator that contains the requested messaging information.

See Returned messaging information.

ErrorCode

This is a number that specifies a predefined error code.

See Service API error codes.

ErrorMessage

This is a text string that describes the error.

Remarks:

To access information about individual messages, iterate through the list of objects contained in result.ReturnValue.

Example code:

The following sample code illustrates how to retrieve details about messages in the Inbox using GetList:

import com.nokia.lib.Service;
var messaging = new Service("Service.Messaging", "IMessaging");
var inParams = {Type:"Inbox"};
var outParams = messaging.GetList(inParams);
if (outParams.ErrorCode == 0) {
  var outList = outParams.ReturnValue;
  var outputEntry = null;
  do {
    outputEntry = outList.next();
    if (null != outputEntry) {
      var messageType = outputEntry.MessageType;
    } else {
      break;
    }
  } while (true);

} else {
  var errorId = outParams.ErrorCode;//various possible errorcodes
}