I have a document that I open using one form and then switch to another form via @command([ViewSwitchForm]). The process works except that I am running into situations where that if I make changes on the first form (in edit mode), I am not prompted to save my changes when I switch to the other form. All of my changes are simply gone. If I save the file (manually) before switching, everything is fine.
Does anyone have any ideas as to why this is happening?
I shouldn’t have to put code in place to save the document everytime that I change screens since this is a basic feature of Notes … recognizing that the document has changed and prompting the user with the choice of saving, or not.
Subject: RE: Not saving changes on Exit
Is there perhaps a SaveOptions field on your form, or some code that assigns SaveOptions?
Please show your code that you use for switching forms.
To switch forms without needing to save, you could use code similar to this.
Subject: RE: Not saving changes on Exit
Thanks. I didn’t have the SaveOptions field. (Never needed it before.) I added it to the form (the one I am switching from) with the value of “1”. This works just like I needed it to operate.
Subject: RE: Not saving changes on Exit
Um, I think you missed my point.
It is not necessary to save changes to switch form. Please look at the link I posted.
If you didn’t like the link I posted, and just want to figure out why the user is not being prompted to save, you could look for code that sets SaveOptions.
It is probably not desirable in most cases to save changes without the user telling you to. When they use your “switch form” control, they are probably not expecting this to save the document. If they have (perhaps accidentally) made some changes they didn’t want to save, you are making it impossible for them to get out without saving. They could be losing a lot of data, they know it will be wiped out, and they have nothing to do to prevent it.
Also, could you maybe use a tabbed table instead of switching forms?