Message
The Email Message object represents a message on the BlackBerry device. This class can be created and used when launching the new message screen using the invoke API or for direct interaction with the message list storage function.
Supported Platform(s)
| - BlackBerry OS 5.0+ | 
| - Ripple Emulator | 
| API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple | 
|---|---|---|---|---|---|---|---|
| blackberry.message.Message | Y | Y | Y | Y | |||
| blackberry.message.Message.find | Y | Y | Y | Y | |||
| save | Y | Y | Y | Y | |||
| STATUS_UNKNOWN | Y | Y | Y | Y | |||
| STATUS_SAVED | Y | Y | Y | Y | |||
| STATUS_DRAFT | Y | Y | Y | Y | |||
| STATUS_SENT | Y | Y | Y | Y | |||
| STATUS_ERROR_OCCURED | Y | Y | Y | Y | |||
| PRIORITY_HIGH | Y | Y | Y | Y | |||
| PRIORITY_MEDIUM | Y | Y | Y | Y | |||
| PRIORITY_LOW | Y | Y | Y | Y | |||
| FOLDER_INBOX | Y | Y | Y | Y | |||
| FOLDER_SENT | Y | Y | Y | Y | |||
| FOLDER_DRAFT | Y | Y | Y | Y | |||
| FOLDER_OUTBOX | Y | Y | Y | Y | |||
| FOLDER_DELETED | Y | Y | Y | Y | |||
| FOLDER_OTHER | Y | Y | Y | Y | 
Configuration Document Settings
| To use all of the API described for this object, you must ensure the following settings are in your configuration document: | 
| You must declare the feature element(s) below in your configuration document: | 
| Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple | 
|---|---|---|---|---|---|---|---|
| <feature id="blackberry.message" /> | Y | Y | Y | Y | |||
| <feature id="blackberry.identity" /> | Y | Y | Y | Y | |||
| <feature id="blackberry.find" /> | Y | Y | Y | Y | 
| Permission Elements (PlayBook and BlackBerry 10+) | 
|---|
| This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. | 
Constructors
Functions
| Message[] | blackberry.message.Message.find | 
| void | save | 
Constants
| Number | STATUS_UNKNOWN | 
| Number | STATUS_SAVED | 
| Number | STATUS_DRAFT | 
| Number | STATUS_SENT | 
| Number | STATUS_ERROR_OCCURED | 
| Number | PRIORITY_HIGH | 
| Number | PRIORITY_MEDIUM | 
| Number | PRIORITY_LOW | 
| Number | FOLDER_INBOX | 
| Number | FOLDER_SENT | 
| Number | FOLDER_DRAFT | 
| Number | FOLDER_OUTBOX | 
| Number | FOLDER_DELETED | 
| Number | FOLDER_OTHER | 
Constructors
                            
                 
                            
                            
                                
                                    blackberry.message.Message
                                    
                                        ([service : blackberry.identity.Service])
                                    
                                
                            
                            
                        
                        The Message object is an instance object, where if a new instance is desired, it must be created using the new keyword.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
| Parameters | |
|---|---|
| service | optional parameter that specifies the type of service that is expected. This value can specify the email service to create an email message for. If no parameter is specified the default email service will be used. | 
Code Example:
|  | 
Functions
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Message[]
                                        
                                        
                                            blackberry.message.Message.find
                                            
                                                
                                                    ([filter : blackberry.find.FilterExpression], [maxReturn : Number], [service : blackberry.identity.Service])
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        This method looks up the messages that matches the expression provided.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
| Parameters | |
|---|---|
| filter | optional parameter that defines the search criteria for the find. If no value is provided the method will return all the Messages on the device for the service provided. | 
| maxReturn | optional integer parameter specifying the maximum number of results to return from the find. If no value is specified, it will return all results found. | 
| service | optional parameter to define which service you wish to search for your messages. If not provided the default service for messages will be used. | 
Code Example:
|  | 
                            
                 
                            
                            
                                
                                    
                                                      
                                        
                                        void
                                        
                                        
                                            save
                                            
                                                
                                                    ()
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        This method will save the changes made to the message object.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
Code Example:
|  | 
Constants
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            STATUS_UNKNOWN
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the UNKNOWN status. The current status cannot be determined.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            STATUS_SAVED
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the SAVED status
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            STATUS_DRAFT
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the DRAFT status
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            STATUS_SENT
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the SENT status
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            STATUS_ERROR_OCCURED
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the ERROR status
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            PRIORITY_HIGH
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing a HIGH priority
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            PRIORITY_MEDIUM
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing a MEDIUM priority
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            PRIORITY_LOW
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing a LOW priority
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            FOLDER_INBOX
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the INBOX folder
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            FOLDER_SENT
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the SENT folder
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            FOLDER_DRAFT
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the DRAFT folder
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |
                            
                 
                            
                            
                                
                                    
                                        static              
                                        
                                        Number
                                        
                                        
                                            FOLDER_OUTBOX
                                            
                                                
                                                    
                                                
                                            
                                                                  
                                    
                                
                            
                            
                        
                        Constant representing the OUTBOX folder
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - Ripple Emulator | |