When exiting a document that has been changed, the message “Do you want to save your changes?” pops up. An answer of “Yes” or “No” is required. Where is the answer stored and how do I access the answer? I need to do something in the QueryClose event that depends on the answer given. Thanks in advance.
Subject: Do you want to save you changes?
As far as I know, you can’t get to the actual answer given.It is built int the product too deep.
But you don’t really need it.
The Querysave-event will only fire if the user did answer ‘Yes’ in that question.
Since we know that, we can set a flag in that event (must, of course, be declared globally in the form) which can be checked in the Queryclose-event.
Hope this helps.
Ken Haggman, NotesHound.
Subject: RE: Do you want to save you changes?
Kenneth,
Thanks for the response. This is an existing application in which there is “special” code is in the queryclose event which have a save in it. The “special” code will have to probably be moved to the querysave event. I was trying to figure a way to get the application to work without moving the code. If I new the user answered “No”, I would bypass the “special” code which has a save.
I don’t think your suggestion would work if there was a prior save before answering “No” to the question. For example, the (1) user keys in data, (2) user saves the data, (3) your suggestion would set the flag in the querysave event, (4) user keys in more data, (5) user hits the escape key or “exit” button, and (6) user answers “No” to question about saving changes. The flag would be set from the first save and then the second changes would also be saved.
Thanks again for your suggestion.
Subject: RE: Do you want to save you changes?
Have you tried putting the code at onbeforeUload event?1. confirm if user really want to close
-
if yes, call window.close()
-
else leave it open
When window close, I’m sure it will run the QueryClose agent?