Hi all,
I’m currently working on a form with several subforms and several Lotusscript libraries (complexity seems to make a difference) .
The save Button executes the following commands :
@Command([FileSave]);
@Command([FileCloseWindow])
While debugging first the querysave events are executed , then the postsave events and then the Messagebox with the standard question :Do you want to save your changes ? Yes or No is displayed.
If one clicks on ‘yes’, Motes restarts executing the Querysave and Postsave events and then finally the Queryclose and closes the document.
Any ideas/suggestions what this, hmmmm, feature is good for ?
If I set the Field Saveoptions=“0” in the button , no messagebox appears, Querysave gets triggered and … Queryclose. No Postsave is executed !!! And in Querysave continue is set to true !
This is really a, mhhhh, strong feature.
As I can’t reproduce it in other forms and its always reproducable in thsi form, I already recreated this form … does not help.
Joe Herrmann
Subject: What are you doing in the PostSave event?
What are you doing in the PostSave? Any document modifications? The Save prompt on FileCloseWindow is because the document is dirty again; that is, Notes has detected changes to the in-memory document since it was read or saved to disk. If you are making changes to the current doc in PostSave, consider whether those changes should be moved to QuerySave.
Subject: 2x Querysave, 2x postsave and 1x queryclose
Jerry,
I have to work with RT-Fields. And if the RT-field was changed by the user,it unfortunatly never worked in the Querysave event as the RT-field did not reflect the changes.I tried RT.update, UIdoc.refersh(true). It did not work at all.
But it works well in Postsave.
I have meanwhile solved this problem with this “intelligent” behaviour of Notes to think the doc is “dirty” if one changes something in the Postsave event. It can be stopped, by simply setting Doc.SaveOptions=“0” at the end of the Postsave event. The somewhat, mhhhhhh, lets say, special implementation of the RT-fields in Lotus Notes/Domino unfortunatly needs this kind of workarounds to make things run well.
Joe
For a successful technology reality must take precedence
over public relations for nature cannot be fooled. R.P. Feynman
Subject: Postsave event
I meanwhile simply ignore the Postsave event in LotusScript. Sometimes it is even not executed, though Querysave was and continue was set to true.
I have made my “own” postsave event:
Dim a global variable ExecPostSave as boolean
Set ExecPostSave in the Postopen Event to false
Set ExecPostSave at the end of the Lotusscript code in the Querysave Event to the value of the continue variable.
Test in Queryclose if ExecPostSave is true and do what ever you wanted to do in Postsave if its true indeed.
Simple … and it works like a charm !
Joe
For a successful technology reality must take precedence
over public relations for nature cannot be fooled. R.P. Feynman