Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 2
Registered: ‎12-28-2009
My Device: Not Specified

How to delete Message on Mailbox and Handheld on BIS programmatically?

Hi,

 

I would like to delete messages on Mailbox and Handheld on BIS programmatically. Can this be achieved? For extra information, I'm working on BIS, not BES. The Email Settings is already configured (Synchronize deleted items between this mailbox and my device is checked), and I'm using a popular mail service which is Yahoo. I can do this manually in the standard BlackBerry Messages application, where you can select a message, click Delete, and you'll be presented with options like Delete on Mailbox and Handheld, and it works.

 

Programmatically, I've tried these (and they are not working) :

 

1. Folder deleteMessage method. This only deletes the message on the handheld, not on the mailbox.

2. Using special subject text like <$removeondelivery>. This is not working too (I think this is for BES only).

 

Any help or insight is greatly appreciated, thanks in advance.

 

 

 

 

 

 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to delete Message on Mailbox and Handheld on BIS programmatically?

If you traverse through all the Folders and delete the messages, it should be get deleted.

 

Have you tried the method, 

 

public boolean deleteMessage(Message msg,
                             boolean forceDeleteSaved)

Parameters: msg - Message to delete from this folder. forceDeleteSaved - If the message is saved, force it's deletion. Returns: True if the message is successfully deleted; otherwise, false (for example, if the message does not exist in this folder).

Since: BlackBerry API 4.0.2


Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 2
Registered: ‎12-28-2009
My Device: Not Specified

Re: How to delete Message on Mailbox and Handheld on BIS programmatically?

Yes, I've tried the deleteMessage of the Folder class. It only deletes the message on the handheld, not on my Yahoo account. But if I manually delete it using standard Messages application, the Yahoo mailbox is successfully deleted. I need to simulate this behaviour programmatically.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to delete Message on Mailbox and Handheld on BIS programmatically?

Programatically we can delete from the store of the device, not on the web.

 

Suggestion, not tried, there are few custom apps I have seen for accessing yahoo or gmail on mobile, this indicated we could access the pop and smtp servers from outside and get the mails from those services and delete them.


Use Search. "Accept Solution" If the problem is resolved.
New Contributor
Posts: 2
Registered: ‎06-05-2009
My Device: Not Specified

Re: How to delete Message on Mailbox and Handheld on BIS programmatically?

[ Edited ]

Go to Messages--Options--Email Reconciliation.  Select your Yahoo email account and make sure "Delete On:" is set to either "Mailbox & Handheld" or "Prompt". 

 

EDIT--I just realized this may not address your issue.  I'm not really sure.  Hopefully it does. 

Developer
Posts: 54
Registered: ‎06-07-2010
My Device: 9780
My Carrier: sw

Re: How to delete Message on Mailbox and Handheld on BIS programmatically?

[ Edited ]

Hi, in my app i need same requirement , delete all text messages programatically at a time...plz send me a snip of code if you solve the problem Smiley Happy thanks in advance