OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

Hi,We are adding some codes in mail template, I found that when call db.openmail does not work when my codes related to open appointment form. the db.isopen returns false.

I saw some other developers have this problem too, anybody know how to solve this problem? or is it R6 bugs?

Thanks a lot,

Subject: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

Why on earth would you have to open the mail database from within the mail database? It’s already open.

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

I know of no reason the OpenMail method should work differently in one context of the client than another, nor have I heard of a problem before now. Please review these suggestions about how to debug code and ask forum questions and see whether you can either solve the problem yourself, or ask the question more clearly. Thanks.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

Hi Andre,Thanks a lot for your quick response,

Before I post my this question, I did some research from this forum, I did found other developers have the same problems, that is why I posted it again. You can find their posts by searching “Openmail”, For example: the following developers: Enrico Leder,

Actually it is really a problem after my test. You can see the problem following these steps:


1.Add these test codes to PostOpen event of Reply form

Dim db As New NotesDatabase( “”, “” )

Call db.OpenMail

If db.IsOpen Then

	Messagebox( db.Title & " on server " & db.Server )

Else

	Messagebox "Maildb is not opened yet"

End If

2.open you calendar

3.Open any existing meeting schedule

4.Click Action, then choose: Send Memo to All Invitees

5.The reply form will be lunched, at the same time, you will see the message which maildb is not opened, isopen returns false.


We want to add customzed codes in the postopen event of reply form, it related to mail db in server, if it is not open in server, then it only points to local replica.

Please let me know if you need any more information, Thanks,

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

I can’t reproduce your problem in 8.0.1, so maybe it has been fixed. Meanwhile, Stan has a good point – why wouldn’t you just use NotesSession.CurrentDatabase, since the code is running in the mail file?

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

Hi Andre,I am using R6.5.1 version, as other developer said, there are not problem in R5, but there is problem in R6. Hopefully, it has been fixed in R8.

The reason we use that as I mentioned in the post, we need do something on server side, I did tried NotesSession.CurrentDatabase, it only open my local replica of maildb, if I do not have local replica of mail file, then I have get error. The thing is that not all employee has local replica of their mail file.

If you can find R6 version and identify it is the the R6 problem, and not problem with R8, then I can wait for R8.

Thanks

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

OpenMail won’t give you what you want anyway. It doesn’t return the server mail file in all cases. It doesn’t for me; it depends on the information in the current location document.

If you want to get the server replica of their mail file, you need to find out which server and filepath. This information is available in the server address book, and can be accessed with the @NameLookup function. Or, you can pull information from the current location document to find the server name for their mail file, and OpenByReplicaID.

To answer the question you actually asked, after OpenMail returned you a database that is not open, did you try using the Open method on it? Did you check the server and filepath, whether they are correct?

Subject: RE: OpenMail does not work in appointment form of Notes mail template, is this R6 bug?

Yes, I did try to use Open method to test it, If you can switch your notes to R6 and do the test as I mentioned in previous post, you will see what I mean. It is a simple test. Basically from that action in Appointment form to lunch reply form, use the test codes I supplied, the IsOpen method after openmail will always return false.

But if I try to use open current database without any problems.

I have changed my code to opencurrentdatabase instead. Just like other developer mentioned, R5 is OK, it is a bug for R6. You have tested R8 is OK, so it seems it is fixed in R8.

Thanks