Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 05:53, 4 October 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Changing the status of a message in Symbian Web Runtime

From Wiki
Jump to: navigation, search

This code snippet demonstrates how to change the status ("Read" or "Unread") of an SMS. The code snippet uses the Messaging Platform Service for Web Runtime, supported from S60 5th Edition onwards.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic
Platform(s): S60 5th Edition
S60 5th Edition
Keywords: device.getServiceObject(), Service.IMessaging.GetList(), Service.IMessaging.ChangeStatus()
Created: ivruban (26 Feb 2009)
Last edited: hamishwillee (04 Oct 2012)


Source: Relevant HTML components

<div id="bodyContent" class="bodyContent">
<select size="5" id="messageList" multiple></select><br />
<input type="radio" name="choiceStatus" id="read" />
<label for="read">Read</label><br />
<input type="radio" name="choiceStatus" id="unread" />
<label for="unread">Unread</label><br />
<input type="button" onclick="changeStatus();"
value="Change status" />


* Changes the status of the selected message.

function changeStatus() {
var messageListElement = document.getElementById("messageList");
var criteria = new Object();
for (var msgIndex = 0; msgIndex < messageListElement.length; msgIndex++) {
if (messageListElement.options[msgIndex].selected) {
// Get message id of the selected message
var messageId = messageListElement.options[msgIndex].value;
// Get numeric representation of the message id
criteria.MessageId = parseInt(messageId, 10);
if (document.getElementById("read").checked) {
criteria.Status = "Read";
} else {
criteria.Status = "Unread";
// Change the status of the message
var result = serviceObj.IMessaging.ChangeStatus(criteria);
if (result.ErrorCode !== 0) {
alert("Error: " + result.ErrorCode);
alert("Status changed.");


The status of the selected message is changed to Read or Unread, depending on the user's selection.

See also

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the WRT stub application used as a template in this snippet is v1.1.

This page was last modified on 4 October 2012, at 05:53.
49 page views in the last 30 days.