Anonymous_User Absent Member.
Absent Member.
1742 views

Message.Move slow...

I am writing a plugin that will move mail but it can take 12 seconds to move the mail via the API when it only take less than a second when going the drag and drop...I've isolated that the delay is in the move command only.

Call GWRootAccount.MailBox.Messages.Move(Message.MessageID, DestMessages)
Labels (1)
0 Likes
5 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Message.Move slow...

I've created a bug to track the problem.

Preston

>>> On Thursday, September 11, 2008 at 4:10 PM, Richard

Giroux<RGiroux@wt.ca>
wrote:
> I am writing a plugin that will move mail but it can take 12 seconds to

move
> the mail via the API when it only take less than a second when going the

drag
> and drop...I've isolated that the delay is in the move command only.
>
> Call GWRootAccount.MailBox.Messages.Move(Message.MessageID, DestMessages)

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Message.Move slow...

I found a work-around....

The token commands to move messages are instant:

Paramstr = "FolderDeepMove(""" + DestPath + """)"
ret = commandr.Execute(Paramstr, results)

This works but I cannot get the tokens to work for moving messages by MessageID. (Using "ItemFolderAltMove")

An explanation of how to use the above token would be helpful.
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Message.Move slow...

You are not doing the command actually like this are you?
Call GWRootAccount.MailBox.Messages.Move(Message.MessageID,
DestMessages)

That is very inefficient. It would instantiate each object each time you
made the
call. Which would entail: getting the folder list (which is very slow),
getting the
messages in the Mailbox folder (which can be very slow) and then doing the
move.

You want to create objects as you go:
GWRootAccount = Appication.MultiLogin()
GWMailBox = GWRootAccount.MailBox
GWMessages = GWMailBox.Messages
GWMessages.Move()

Of course you would keep the objects around as long as is prudent.
You don't want to keep instantiating the objects for each function call.

Preston

>>> On Wednesday, September 17, 2008 at 12:44 PM, Richard

Giroux<RGiroux@wt.ca>
wrote:
> I found a work-around....
>
> The token commands to move messages are instant:
>
> Paramstr = "FolderDeepMove(""" + DestPath + """)"
> ret = commandr.Execute(Paramstr, results)
>
> This works but I cannot get the tokens to work for moving messages by
> MessageID. (Using "ItemFolderAltMove")
>
> An explanation of how to use the above token would be helpful.

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Message.Move slow...

Set GWApp = CreateObject("NovellGroupWareSession")
Set GWRootAccount = GWApp.Login("", "")
Set OrgMessages = GWRootAccount.MailBox.Messages
Call OrgMessages.Move(Message.MessageID, DestMessages) ' Message is defines elsewhere as a global var
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Message.Move slow...

I'm not able to recreate the problem.
Here is a simple test that I ran:

Private Sub btnTest_Click()
Dim gwAcct As Account9
Dim gwApp As Application5
Dim gwCabinet As Folder7
Dim gwMailbox As Folder7
Dim gwMessage As Message3
Dim gwCMessages As Messages3
Dim gwMMessages As Messages3
Dim str As String
str = "/ipa-" + txtServer.Text + " /ipp-" + txtPort.Text

Set gwApp = CreateObject("NovellGroupwareSession")
gwApp.MultiLoginAddressBookSupport = True
Set gwAcct = gwApp.MultiLogin(txtUserId.Text, str, txtPassword.Text)

Set gwMailbox = gwAcct.MailBox
Set gwMMessages = gwMailbox.Messages
Set gwCabinet = gwAcct.Cabinet
Set gwCMessages = gwCabinet.Messages
Set gwMessage = gwMMessages.Add("GW.MESSAGE.MAIL", egwPersonal)
gwMessage.Subject.PlainText = "This is the message to test"
Set gwMessage = gwMMessages.Move(gwMessage.MessageID, gwCMessages)

Set gwMessage = Nothing
Set gwMMessages = Nothing
Set gwCMessages = Nothing
Set gwCabinet = Nothing
Set gwMailbox = Nothing
Set gwAcct = Nothing
Set gwApp = Nothing
End Sub

The move is instantaneous.
Is the problem on all users or just one user?
If you run this test, do you still have the problem?

Thanks.
Preston

>>> On Friday, September 19, 2008 at 2:18 PM, Richard Giroux<RGiroux@wt.ca>

wrote:
> Set GWApp = CreateObject("NovellGroupWareSession")
> Set GWRootAccount = GWApp.Login("", "")
> Set OrgMessages = GWRootAccount.MailBox.Messages
> Call OrgMessages.Move(Message.MessageID, DestMessages) ' Message is

defines
> elsewhere as a global var

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.