GetList()

Description:

The GetList method retrieves a list of available calendars or calendar entries. Calendar entries are retrieved from the specified calendar or, if no calendar is specified, from the default one.

This is a synchronous method.

Syntax:

GetList(parameters:Object):Object

Arguments:

Return value:

The GetList method returns an object that contains the requested calendar 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 calendar information.

See Returned calendar information.

ErrorCode

This is a number that specifies a predefined error code.

See Service API error codes.

ErrorString

This is a text string that describes the error.

Remarks:

  • If entries are retrieved from a calendar other than the default one, the corresponding calendar file must exist on the device.

  • For detailed information about calendar entries, see section Calendar entries.

Example code:

The following sample code illustrates how to retrieve a calendar:

import com.nokia.lib.Service;
var calender = new Service("Service.Calendar", "IDataSource");
var inParams = {Type:"CalendarEntry"};
var outParams = calender.GetList(inParams);
var outList = outParams.ReturnValue;
var outputEntry = null;
do {
    outputEntry = outList.next();
    if (null != outputEntry) {
        var id = outputEntry.id;
    } else {
        break;
    }
} while (true);