Академический Документы
Профессиональный Документы
Культура Документы
version 2.0
At the time of publication, this documentation is based on BlackBerry MDS Studio version 2.0.
©2008 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, SureType® and related trademarks, names,
and logos are the property of Research In Motion Limited and are registered and/or used in the U.S. and countries around the world.
JavaScript is a trademark of Sun Microsystems. All other trademarks are the property of their respective owners.
The BlackBerry smartphone and other devices and/or associated software are protected by copyright, international treaties, and various
patents, including one or more of the following U.S. patents: 6,278,442; 6,271,605; 6,219,694; 6,075,470; 6,073,318; D445,428; D433,460;
D416,256. Other patents are registered or pending in the U.S. and in various countries around the world. Visit www.rim.com/patents for a list of
RIM (as hereinafter defined) patents.
This documentation including all documentation incorporated by reference herein such as documentation provided or made available at
www.blackberry.com/go/docs is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition, endorsement, guarantee,
representation, or warranty of any kind by Research In Motion Limited and its affiliated companies ("RIM") and RIM assumes no responsibility
for any typographical, technical, or other inaccuracies, errors, or omissions in this documentation. In order to protect RIM proprietary and
confidential information and/or trade secrets, this documentation may describe some aspects of RIM technology in generalized terms. RIM
reserves the right to periodically change information that is contained in this documentation; however, RIM makes no commitment to provide
any such changes, updates, enhancements, or other additions to this documentation to you in a timely manner or at all.
This documentation might contain references to third-party sources of information, hardware or software, products or services including
components and content such as content protected by copyright and/or third-party web sites (collectively the "Third Party Products and
Services"). RIM does not control, and is not responsible for, any Third Party Products and Services including, without limitation the content,
accuracy, copyright compliance, compatibility, performance, trustworthiness, legality, decency, links, or any other aspect of Third Party Products
and Services. The inclusion of a reference to Third Party Products and Services in this documentation does not imply endorsement by RIM of
the Third Party Products and Services or the third party in any way.
EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION, ALL CONDITIONS, ENDORSEMENTS,
GUARANTEES, REPRESENTATIONS, OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY
CONDITIONS, ENDORSEMENTS, GUARANTEES, REPRESENTATIONS OR WARRANTIES OF DURABILITY, FITNESS FOR A PARTICULAR
PURPOSE OR USE, MERCHANTABILITY, MERCHANTABLE QUALITY, NON-INFRINGEMENT, SATISFACTORY QUALITY, OR TITLE, OR ARISING
FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING OR USAGE OF TRADE, OR RELATED TO THE DOCUMENTATION OR ITS USE,
OR PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND
SERVICES REFERENCED HEREIN, ARE HEREBY EXCLUDED. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE.
SOME JURISDICTIONS MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. TO THE EXTENT
PERMITTED BY LAW, ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT THEY CANNOT
BE EXCLUDED AS SET OUT ABOVE, BUT CAN BE LIMITED, ARE HEREBY LIMITED TO NINETY (90) DAYS FROM THE DATE YOU FIRST
ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, IN NO EVENT SHALL RIM BE LIABLE FOR ANY TYPE
OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE,
HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN INCLUDING WITHOUT LIMITATION ANY
OF THE FOLLOWING DAMAGES: DIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR AGGRAVATED
DAMAGES, DAMAGES FOR LOSS OF PROFITS OR REVENUES, FAILURE TO REALIZE ANY EXPECTED SAVINGS, BUSINESS INTERRUPTION,
LOSS OF BUSINESS INFORMATION, LOSS OF BUSINESS OPPORTUNITY, OR CORRUPTION OR LOSS OF DATA, FAILURES TO TRANSMIT OR
RECEIVE ANY DATA, PROBLEMS ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES,
DOWNTIME COSTS, LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES,
COST OF SUBSTITUTE GOODS, COSTS OF COVER, FACILITIES OR SERVICES, COST OF CAPITAL, OR OTHER SIMILAR PECUNIARY LOSSES,
WHETHER OR NOT SUCH DAMAGES WERE FORESEEN OR UNFORESEEN, AND EVEN IF RIM HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, RIM SHALL HAVE NO OTHER OBLIGATION, DUTY,
OR LIABILITY WHATSOEVER IN CONTRACT, TORT, OR OTHERWISE TO YOU INCLUDING ANY LIABILITY FOR NEGLIGENCE OR STRICT
LIABILITY.
THE LIMITATIONS, EXCLUSIONS, AND DISCLAIMERS HEREIN SHALL APPLY: (A) IRRESPECTIVE OF THE NATURE OF THE CAUSE OF
ACTION, DEMAND, OR ACTION BY YOU INCLUDING BUT NOT LIMITED TO BREACH OF CONTRACT, NEGLIGENCE, TORT, STRICT LIABILITY
OR ANY OTHER LEGAL THEORY AND SHALL SURVIVE A FUNDAMENTAL BREACH OR BREACHES OR THE FAILURE OF THE ESSENTIAL
PURPOSE OF THIS AGREEMENT OR OF ANY REMEDY CONTAINED HEREIN; AND (B) TO RIM AND ITS AFFILIATED COMPANIES, THEIR
SUCCESSORS, ASSIGNS, AGENTS, SUPPLIERS (INCLUDING AIRTIME SERVICE PROVIDERS), AUTHORIZED RIM DISTRIBUTORS (ALSO
INCLUDING AIRTIME SERVICE PROVIDERS) AND THEIR RESPECTIVE DIRECTORS, EMPLOYEES, AND INDEPENDENT CONTRACTORS.
IN ADDITION TO THE LIMITATIONS AND EXCLUSIONS SET OUT ABOVE, IN NO EVENT SHALL ANY DIRECTOR, EMPLOYEE, AGENT,
DISTRIBUTOR, SUPPLIER, INDEPENDENT CONTRACTOR OF RIM OR ANY AFFILIATES OF RIM HAVE ANY LIABILITY ARISING FROM OR
RELATED TO THE DOCUMENTATION.
Prior to subscribing for, installing, or using any Third Party Products and Services, it is your responsibility to ensure that your airtime service
provider has agreed to support all of their features. Installation or use of Third Party Products and Services with RIM's products and services
may require one or more patent, trademark, copyright, or other licenses in order to avoid infringement or violation of third party rights. You are
solely responsible for determining whether to use Third Party Products and Services and if any third party licenses are required to do so. If
required you are responsible for acquiring them. You should not install or use Third Party Products and Services until all necessary licenses
have been acquired. Any Third Party Products and Services that are provided with RIM's products and services are provided as a convenience to
you and are provided "AS IS" with no express or implied conditions, endorsements, guarantees, representations, or warranties of any kind by
RIM and RIM assumes no liability whatsoever, in relation thereto. Your use of Third Party Products and Services shall be governed by and
subject to you agreeing to the terms of separate licenses and other agreements applicable thereto with third parties, except to the extent
expressly covered by a license or other agreement with RIM.
The terms of use of any RIM product or service are set out in a separate license or other agreement with RIM applicable thereto. NOTHING IN
THIS DOCUMENTATION IS INTENDED TO SUPERSEDE ANY EXPRESS WRITTEN AGREEMENTS OR WARRANTIES PROVIDED BY RIM FOR
PORTIONS OF ANY RIM PRODUCT OR SERVICE OTHER THAN THIS DOCUMENTATION.
Published in Canada
Contents
Standard environment ...................................................................................................................................... 13
Data types ........................................................................................................................................................ 13
Enumerated data types .......................................................................................................................... 14
Date data types ....................................................................................................................................... 14
Binary data types ..................................................................................................................................... 14
Data type conversion .............................................................................................................................. 14
Parameters ....................................................................................................................................................... 18
Global symbols ................................................................................................................................................19
Dialog ........................................................................................................................................................19
Screen .......................................................................................................................................................19
BlackBerry MDS data component global symbols .............................................................................19
Data types
The following data types are returned to JavaScript®, based on access to the BlackBerry MDS Studio Application
symbols:
• array
• binary
• boolean
• data component
• date
• decimal
• enumerated
• integer
• long
• message component
• screen component
• string
The following data types are returned from component elements as primitive JavaScript variables:
• boolean
• decimal
• integer
• long
• string
You can use simple comparisons, such as != or ==. You do not need to call functions on objects. In BlackBerry MDS
Studio, types boolean, integer, decimal, and string can be represented as objects in JavaScript.
BlackBerry MDS Studio JavaScript Environment
10
1: Standard environment
Data type conversion rules constrain the conversion results to avoid questionable or invalid results. Semantic
operators describe the valid conversions between different data types.
11
BlackBerry MDS Studio JavaScript Environment
12
1: Standard environment
13
BlackBerry MDS Studio JavaScript Environment
Parameters
You can declare parameters explicitly in either the screen or script definition in the screen editor and BlackBerry
MDS Studio Script Editor. You can define multiple parameters, only as type BlackBerry MDS data component.
14
1: Standard environment
Global symbols
Dialog
The Dialog global symbol enables script-based control of BlackBerry MDS Runtime dialog boxes.
Field Description
OK dialog type OK
YES_NO dialog type Yes/No
OK_BUTTON button type OK
YES_BUTTON button type Yes
NO_BUTTON button type No
Screen
The Screen global symbol enables you to control screen management using script.
15
BlackBerry MDS Studio JavaScript Environment
16
2
BlackBerry MDS Studio components and
script
Screen component access
Message component access
Data component access and creation
You cannot create message and screen components explicitly using script, but they are available to the BlackBerry
MDS Studio environment and behave similarly to other JavaScript object types. You can create data component
instances using the create() function.
// Here we iterate all the choices and combine into one string
var choicesString = "";
var choices = scrHorseRacing.slPlacedBets.value; // Returns an array
for(i=0;i < choices.length;i++)
choicesString = choicesString + choices[i]; // Adds the current string
Note that only a string array can be assigned to the value field of these controls.
18
2: BlackBerry MDS Studio components and script
With the exception of Label, Separator, Image, Button, Region, and Menu item controls, each control has mapping
field, which is of the type defined in the mapping attribute of the control. It is read-only in script and reflects the
mapping result of the control. The mapping field is often used to access the selected item in choice or repetition
controls.
Property Description
columns This property is an array of the column controls in the table.
selectedColumnIndex This property is the index of the selected column.
selectedRowIndex This property is the index of the selected row.
19
BlackBerry MDS Studio JavaScript Environment
You can create a data component instance using the create() function on the data component type global
symbol. The following example creates a Horse data component with the primary key set to "Bill the Horse."
var h = Horse.create("Bill the Horse");
Arrays
Arrays are used throughout the BlackBerry MDS Studio application. Global variables and nested data component
fields can be declared as arrays.
Arrays returned from references to application definitions behave similarly to JavaScript arrays, with subtle
differences. Like JavaScript arrays, the BlackBerry MDS Studio arrays can be indexed using the element notation
[], but they support extended functions. Arrays returned in this way support only a subset of the standard
JavaScript array functions.
Unlike JavaScript arrays, an explicit push() must be used to increase the size of the BlackBerry MDS Studio array.
This is in contrast to JavaScript arrays where the element notation [] can be used to both reference the element
and increase the array size to store a new value.
20
2: BlackBerry MDS Studio components and script
21
BlackBerry MDS Studio JavaScript Environment
22
3
Organizer data access
Contact component
Address component
Event component
Attendee component
RepeatRule component
Message component
Task component
System component
DeviceInfo component
Error component
Organizer enumerated data types
Organizer data is exposed to the BlackBerry MDS Studio application through a set of standard data component
definitions. These data definitions are similar to user-defined data definitions; they have fields, they support
functions, and so on. The fields provided by the standard data components are fixed and are reflective of the
organizer information they convey.
Keyed standard components do not require a primary key value to create them. Each keyed standard component
has a unique identifier (UID) primary key field that is managed by the BlackBerry MDS Runtime.
Contact component
The Contact data component updates or retrieves information from the address book application on the
BlackBerry® device. The Contact data component comes with a predefined set of fields and supports regular data
component functions such as create(), findWhere(), and removeAll(). Contact is a keyed data collection.
Address component
The Address keyless data component is part of the Contact keyed data component. Address data components have
no primary key.
24
3: Organizer data access
Event component
The Event data component finds or creates meetings and appointments in the calendar application. Event is a
keyed data collection.
25
BlackBerry MDS Studio JavaScript Environment
e.attendees.push(Attendee.create(), Attendee.create());
e.attendees[0].address = "bill@sample.com";
e.attendees[1].address = "jsmith@abcco.net";
e.free_busy = FREEBUSY.OUT_OF_OFFICE;
e.allday = true;
Attendee component
The Attendee keyless data component is part of the Event keyed data component. Attendee data components do
not have a primary key.
RepeatRule component
The RepeatRule keyless data component is part of the Event keyed data component. It defines the frequency or
recurrence of an event. RepeatRule data components do not have a primary key.
26
3: Organizer data access
Message component
The Message component can be used to create a new email message that is to be sent or to retrieve an email
message that is stored on the device. Message is a keyed data collection.
Task component
The Task data component is used to add or search for tasks in the task list on the BlackBerry device. Task is a keyed
data collection.
27
BlackBerry MDS Studio JavaScript Environment
System component
The System component does not contain any fields but provides the following system functions:
• exit()
• loadURL()
• startCall()
DeviceInfo component
The DeviceInfo component enables you to inspect BlackBerry device information. This component is read-only,
and you cannot assign new values to the component.
28
3: Organizer data access
Error component
The Error data component enables you to retrieve error information when an error occurs. This component is read-
only and cannot be assigned new values. A default error handling script is generated for the application by the
BlackBerry MDS Studio. This script is run by the BlackBerry MDS Runtime when an error situation is detected. This
script can be modified or extended by the developer of the BlackBerry MDS Studio application.
29
BlackBerry MDS Studio JavaScript Environment
Error categories
Category Meaning
CATEGORY_MDS_SERVICES_ERROR BlackBerry MDS Services error
CATEGORY_MDS_RE_ERROR BlackBerry MDS Runtime error
CATEGORY_CONNECTOR_ERROR type of errors that occur in the back-end connectors such as web service and database connector
Error codes
Code Meaning Category
METADATA_ERROR metadata error MDS_RE_ERROR
OUT_QUEUE_FULL queue for outgoing messages is full MDS_RE_ERROR
OUT_QUEUE_CRITICAL queue for outgoing messages is almost full MDS_RE_ERROR
JAVA_SCRIPT_ERROR runtime ECMAScript error MDS_RE_ERROR
INCOMING_MESSAGE_ERROR error occurs when receiving a message MDS_RE_ERROR
OUTGOING_MESSAGE_ERROR error occurs when sending a message MDS_RE_ERROR
SERVER_INTERNAL_ERROR BlackBerry MDS Services has an internal error MDS_SERVICES_ERROR
SERVER_MAPPING_ERROR error occurs during mapping of BlackBerry MDS Studio MDS_SERVICES_ERROR
application complex data types to data source defined
data types by BlackBerry MDS Services
SERVER_TRANSFORMATION_ERROR transformation error occurs on BlackBerry MDS Services MDS_SERVICES_ERROR
SERVER_SECURITY_ERROR security error occurs on BlackBerry MDS Services MDS_SERVICES_ERROR
BACKEND_CONNECTOR_ERROR backend connector error MDS_SERVICES_ERROR
MESSAGE_TOO_LARGE a message is too large to be processed MDS_SERVICES_ERROR
SOAP_AUTH_ERROR authorization error CONNECTOR_ERROR
SOAP_SECURITY_ERROR Simple Object Access Protocol (SOAP) security error CONNECTOR_ERROR
SOAP_ENDPOINT_UNAVAILABLE_ERROR endpoint is unavailable CONNECTOR_ERROR
SOAP_MESSAGE_INVALID_ERROR message is invalid CONNECTOR_ERROR
SOAP_CONNECTOR_ERROR SOAP connector error CONNECTOR_ERROR
SOAP_BACKEND_ERROR SOAP fault received from the web service, pool error CONNECTOR_ERROR
during web service connection, or web service request
time out
SOAP_NETWORK_ERROR occurs when proxy error codes HTTP 502 or HTTP 504 are CONNECTOR_ERROR
received
WSE_SUBSCRIBE_ERROR subscription request fails CONNECTOR_ERROR
WSE_UNSUBSCRIBE_ERROR unsubscription request fails CONNECTOR_ERROR
WSE_UNSUBSCRIBE_SUBSCRIPTION_NOT_ an unsubscribe request is received, but no corresponding CONNECTOR_ERROR
FOUND_ERROR subscription is found
Logger component
The Logger component enables you to log runtime messages. You can log three types of messages from a script:
INFORMATION, WARNING and ERROR.
30
3: Organizer data access
31
BlackBerry MDS Studio JavaScript Environment
32
4
Application integration
Organizer applications
GPS access
BlackBerry MDS Runtime application integration
Java application integration
Invoke other BlackBerry applications from your BlackBerry MDS Runtime application using the System.exec() function.
Organizer applications
Address Book application
Access the Address Book application.
var contact = Contact.create()
var isNewView = true;
Parameters
Parameter Description
contact Contact to view or create in the Address Book application.
Calendar application
Access the Calendar application.
var event = Event.create()
var date = newDate;
Parameters
Parameter Description
event Event to view or create in the Calendar application.
date Date to view in the Calendar application.
Email application
Access the Email application.
var message = Message.create();
message.subject = "Hey";
message.recipients = "jblack@bb.com";
message.content = "How are you?";
34
4: Application integration
Parameters
Parameter Description
message Newly drafted or created email to send.
content Content of the new message.
recipients Recipients for the message.
subject Subject for the message.
Phone application
Access the Phone application.
var isSmartDialing = false;
Parameters
Parameter Description
number Phone number to dial in the Phone application.
Maps application
Access the Maps application.
var contact = Contact.create();
var addressIndex = 1;
35
BlackBerry MDS Studio JavaScript Environment
Parameters
Parameter Description
contact Name of a contact in the address book.
addressIndex Phone book address of the contact to use, from 0 to 9.
address Address to search on the map.
location Coordinates to search on the map.
Tasks application
Access the Tasks application.
var task = Task.create()
var isNewView = true;
System.exec(APP_TYPE.TASKS.task); //opens the Task edit window with the specified task.
Parameters
Parameter Description
task Task to open or create in the Tasks application.
GPS access
Access GPS-related information.
blackberry.location.refreshLocation(); //updates the BlackBerry location.
36
4: Application integration
Parameters
Parameter Description
method Method to call when the location changes.
aidMode The aid mode to use: 0 for cellsite, 1 for assisted, and 2 for autonomous.
Parameters
Parameter Description
parameters A string array of parameters for the application.
Parameters
Parameter Description
parameters A string array of parameters for the application.
37
BlackBerry MDS Studio JavaScript Environment
38
5
BlackBerry MDS Studio functions
Screen functions
Data functions
Message functions
Organizer functions
You cannot create message and screen components explicitly using script, but they are available to the BlackBerry
MDS Studio environment and behave similarly to other JavaScript object types. You can create data component
instances using the create() function.
Screen functions
Function: close
This function closes the current screen. If the screen is not the only one on the stack, the previous screen is
displayed. If it is the only screen, the BlackBerry MDS Runtime Application would exit.
void close([boolean keepOnScreenData])
Parameters
Parameter Description
keepOnScreenData True to keep the data entered on the screen that is about to close, otherwise, discard the data;
default value is false
Returns
This function returns nothing.
Function: display
This function displays a dialog of the type specified, presenting the message string provided.
int display(string:msg [, int:dialog_type])
BlackBerry MDS Studio JavaScript Environment
Parameters
Parameter Description
msg string to display
dialog_type either Dialog.OK or Dialog.YES_NO. The default is OK.
Returns
This function returns the result of your selection, indicating the specified button type.
Function: refresh
This function refreshes the current screen.
void refresh()
Returns
This function returns nothing.
Data functions
Function: all
This function returns all instances of the collection identified by the BlackBerry MDS Studio data component
name.
Array all()
Returns
This function returns the entire collection. This might result in an empty array.
40
5: BlackBerry MDS Studio functions
Code sample: Using the create function with keyless data components
var aAddress = Address.create();
Returns
This function returns the new keyless data instance.
Parameters
Parameter Description
pkey primary key values used to create the data component instance; the data type of pkey can be string, integer, decimal, date,
enumeration, or keyed data component
In the BlackBerry MDS Studio, you cannot specify a boolean value for a primary key.
If another instance with this primary key is found, that instance is returned. The create() function never returns a null
value.
Returns
This function returns the new or found keyed data instances.
41
BlackBerry MDS Studio JavaScript Environment
Parameters
Parameter Description
pkey primary key value used to create the data component instance; the data type of pkey can be string, integer, decimal, date,
enumeration, or keyed data component
In the BlackBerry MDS Studio, you cannot specify a boolean value for a primary key.
If another instance with this primary key is found, that instance is returned. The create() function never returns a null
value.
Returns
This function returns the new or found keyed data instance.
Function: display
This function displays the named screen using the specified arguments.
void display(Data:parm1, Data:parm2 …)
Parameters
Parameter Description
parm data component objects passed to the screen for display; the number required is dependent upon the screen definition
Returns
This function returns nothing.
Parameters
Parameter Description
pkey primary keys used to resolve the keyed data component; it can be one of the primitive data types (except boolean) or a keyed
data component that is one of the primary keys
Returns
This function returns the found instance or null if an instance is not found.
42
5: BlackBerry MDS Studio functions
Parameters
Parameter Description
pkey primary key used to resolve the keyed data component; it can be one of the primitive data types (except boolean) or a keyed
data component that is the primary key
Returns
This function returns the found instance or null if an instance is not found.
Function: findWhere
This function is available only for keyed data components.
Array findWhere(string:clause)
Parameters
clause - "[fieldname operator value][ORDERBY fieldname_orderby ASC/DESC]"
43
BlackBerry MDS Studio JavaScript Environment
Parameter Explanation
fieldname field name; arrays are not supported, but if the field is a data component, the equal (=) and not equal (<>) operators
are supported
operator = (equal)
<> (not equal)
!= (not equal)
< (less than)
<= (less or equal)
> (greater than)
>= (greater or equal)
Only = and <> are supported for data components.
value value for comparison; when a literal value is specified it must be enclosed in single or double quotation marks
fieldname_orderBy field used for sorting the results; it can only be a nonarray primitive field
Returns
This function returns an array. The array is empty if nothing is found.
Function: pop
This function removes the last element from the array.
void pop()
Returns
This function returns nothing.
Function: property
This function returns the number of elements in the array.
property: length
44
5: BlackBerry MDS Studio functions
Returns
This function returns the number of elements in the array.
Function: push
This function adds the provided objects, in order, to the end of the array.
void push(Object:parm1, Object:parm2 …)
Parameters
Parameter Description
parm objects to be pushed into the array
Returns
This function returns nothing.
Function: remove
This function removes the data instance.
void remove()
Returns
This function returns nothing.
45
BlackBerry MDS Studio JavaScript Environment
Function: remove
This function removes the object instances.
void remove(Object:parm1, Object:parm2 …)
Parameters
Parameter Description
parm objects to be removed from the array
Returns
This function returns nothing.
Function: removeAll
This function is available only for keyed data collections. It removes all instances of the collection identified by the
BlackBerry MDS Studio data component name.
void removeAll()
Returns
This function returns nothing.
Message functions
Function: contains
This function confirms whether or not this instance is contained.
boolean contains(Object:parm)
46
5: BlackBerry MDS Studio functions
Parameters
Parameter Description
parm object to find
Returns
This function returns true if contained, false is returned otherwise.
Function: send
This function sends the named message.
outSubmitBet.send();
Returns
This function returns nothing.
Organizer functions
Function: exit
This function exits the current running BlackBerry MDS Studio application.
System.exit();
Returns
This function returns nothing.
Function: loadURL
This function loads the URL specified and brings the browser to the foreground.
System.loadURL("www.rim.com")
47
BlackBerry MDS Studio JavaScript Environment
Parameters
Parameter Description
URL string of the URL to be loaded by the browser, for example, “http://www.rim.com”
Returns
This function returns nothing.
Function: log
This function logs the message specified.
void log(string source, string message[, int type])
Parameters
Parameter Description
source source of the message, for example, "myScript"; this parameter is optional
message message to log
type type of message; it can be any of the following:
• Logger.INFORMATION
• Logger.WARNING
• Logger.ERROR
Logger.INFORMATION is the default
Returns
This function returns nothing.
Function: send
This function sends an email message to the addresses specified in the To, cc, and bcc fields.
48
5: BlackBerry MDS Studio functions
Returns
This function returns the status of the message being sent. The status will be one of the following:
• Message.SENT - Sent successfully.
• Message.ERROR_OCCURRED - An error occurs and the message is not sent.
• Message.SAVED_DRAFT - The message is saved as draft and is not sent.
Function: startCall
This function makes a phone call using the specified telephone number.
System.startCall("4165554444");
Parameters
Parameter Description
number telephone number to call
Returns
This function returns nothing.
49
BlackBerry MDS Studio JavaScript Environment
50
©2008 Research In Motion Limited
Published in Canada.