Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

Versions 8.0 and later of Notes have a bug (SPR #AGUD7DSU3Q) where if there's a Queryclose event on a form, and the document is not "dirty," the Eclipse environment closes the document tab first, and only then does the Queryclose event run. This is too late to prevent the document from closing using Continue = False (though everything else the event might do works, as far as I know, because the document is still open in a hidden window "behind the scenes" until the C++-side code agrees that it's closed).

I'm working with the people involved to get a good fix, but in the meantime there's an interim fix you should know about for 8.5 and, I believe, 8.0.3 (check the release notes).  If you add a computed field (I think it can also be Computed for Display)  $HasAbortQueryClose with value "1", Eclipse will consider the window "dirty" and won't close it without first asking permission from core, which causes the Queryclose code to run.

I know, it's a pain in the nether regions, and it breaks existing applications. I don't like it any better than you do. At least the Design Element Search tool will let you quickly find all forms (and subforms, don't forget them. And pages) that contain Queryclose code.

The obvious question you may be thinking is, why wouldn't we just automatically do this for every window? This is what I asked.  The answer was that dirty windows are always brought to the front when you ask to close them and they aren't already in front (for instance when shutting down the client). Since this takes time to do, it's a performance bottleneck when shutting down the client, which is one of the things the client team was asked to optimize.  They felt they couldn't meet their target, if every window had to be activated when shutting down.

Andre Guirard | 3 November 2008 10:05:50 AM ET | Home, Plymouth, MN, USA | Comments (14)


1) QueryClose annoyances
Neil | 11/3/2008 3:12:45 PM

Hmm whilst I understand needing to hit a target, and the importance of client performance, I think this was the wrong decision.

Breaking an unknown number of Notes client applications for close down performance is not a compromise I would do... I would expect my developers to explain the issue and then explain why the target cant be hit.

2) QueryClose annoyances
Charles Robinson | 11/3/2008 3:48:43 PM

Aren't changes that break existing applications considered regression bugs?

3) QueryClose annoyances
Andre Guirard | 11/3/2008 10:25:20 PM

I'm not terribly enthusiastic about that choice either, but I thought I should alert you. It's easy to miss a release note and this is an important one.

While you might not agree with the reasoning, I thought people might appreciate knowing what it was.

I'll push for a better way, but I'm afraid it's too late for 8.5. Partly we're dealing with the limitations of Eclipse, as to what it does when you say you want to close something. A possibility is to change Eclipse so that it lets the editor register a listener to get a word in about whether it'll allow itself to be closed, without going all the way to making it dirty. It takes a while and often, negotiation, to get an Eclipse change, and if we do that, then we can implement this right -- as opposed to some kludge like discovering the window shouldn't have been closed and reopening it, passing it our core window handle.

4) QueryClose annoyances
Jaime | 11/4/2008 1:35:01 PM

This may be a dumb question but does this occur regardless of client install (basic vs standard) ?

5) QueryClose annoyances
$HasAbortQueryClose field | 11/5/2008 5:38:14 AM

Can you use the $HasAbortQueryClose field even in older Notes versions?

6) QueryClose annoyances
Andre Guirard | 11/5/2008 11:26:29 AM

Jaime: it's only a problem in the standard client.

$Has: adding the field only helps in 8.0.3 or later, or 8.5 or later. In 8.0 thru 8.0.2, you would have to arrange for the document to be "dirty" -- then your queryclose code will work.

7) QueryClose annoyances
Andrew Brew | 11/5/2008 5:06:20 PM

And what constitutes a "dirty" document?

8) QueryClose annoyances
Richard Neville | 11/5/2008 10:39:15 PM

Hi. I've tried, but I can't reproduce this bug.

I'm running Notes 8.02, and in a minimal test form that doesn't dirty anything - it doesn't have any items at all, and the only code is in the queryclose event - the query close code always runs, and I can choose to keep editing the document, and it stays open.

Can you suggest what's going wrong (well, right)?

9) QueryClose annoyances
Andre Guirard | 11/7/2008 8:36:08 AM

Richard: the error only occurs in the "standard client" -- could it be you're in "basic" mode?

Andrew: a document is "dirty" if it's in edit mode and a field has been modified since the document was opened (other than by the Postopen event). Basically, if you would be promoted to save the document if you pressed Esc. However, the core code and the Eclipse environment can have different ideas about the document's state.

10) QueryClose annoyances
Gabriel Amorim | 11/10/2008 7:50:27 AM

Our company is begining to think about upgrading. I'd rather wait for this document of Andre regarding the upgrade issues before doing something against the grain! (version 7 works like a charm in our environment)

The one thing I realized during my tests with the client 8 is that it really consumes lots of memory and leaks more than the older version. The 8.5 beta is a bit unstable.

11) QueryClose annoyances
Louis L. | 12/15/2008 12:32:20 PM


How do we usethe Design Element Search tool to quickly find all forms (and subforms,And pages) that contain Queryclose code?

I have tried searching my dbs for continue = false and the code is not found.

Please advise how to use tool to search for "Events" like QueryClose.


12) QueryClose annoyances
Andre Guirard | 12/18/2008 9:49:12 AM

Why wouldn't you just search for "queryclose"?

13) QueryClose Annoyances
Louis L. | 1/7/2009 10:52:46 AM

Hi Andre,

We downloaded yesterday's Passport release of version 8.5 and the QueryClose bug was not resolved :-(

Our IBM support rep tested a 8.5 beta and informed us that it was resolved about a month ago, however the current release still bypasses the event code.

Do you have any projections as to when these fixes might be implemented. This bug is delaying our upgrade plans. Thanks for your assistance, as always!

14) QueryClose annoyances
Andre Guirard | 1/9/2009 11:24:09 AM

The "fix" is as I have described -- you must have the special field on your form or the Queryclose event executes too late to do any good.

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact