How to save the form automatically? How can we do this?
Regards,
Sai.
How to save the form automatically? How can we do this?
Regards,
Sai.
Subject: Notes Form
Depends on when and where we would want to do this.
Subject: RE: Notes Form
Hi,
Once the user does any changes in the form and closes it, it should not prompt him for saving the changes and it must save automatically.
Please help…
Regards,
Sai.
Subject: RE: Notes Form
First off, I’m not sure if I would want to do that. Usually you should give your users at least the option to Save & Close or Cancel out of a document. The first action requires two lines of code, the second only one, and users know exactly what’s going to happen, if the click one of those. In case they close the document by other means, Notes will prompt them, if they made any changes.
If you still have to do implement an automatic save on close, you’ll need to spend some more time (just to possibly confuse users). One way would be, to set a SaveOptions field to “0” in PostOpen (this will suppress the Notes generated dialog asking, if you want to save your changes, but also keep the document from being saved). Then in QueryClose, you could set SaveOptions to “1” and issue a Source.Save.
This does what you asked for at a first glance, but some issues still remain:
Saving the NotesUIDocument only works, if the document is in edit mode. So, the automated save surely works best, if the form property to open in edit mode automatically is set. But even then, users could still put the document back to read mode, if you don’t prevent this from the QueryModeChange event.
You also will want to deal with new documents. If a user creates a new doc, but closes it without filling out any fields. You can’t simply disable automatic saving for new documents, because this is still what you want, if the user did provide input.
That’s a small collection of issues to deal with from the top of my head. Could be more I didn’t think of.