@Command([FileSave]) not saving
I have an action button on a form that is only visible in edit mode. The button is labeled "Save & Close". The code under the button is:
@If(@Command([FileSave]); @Command([FileCloseWindow]); "");
I have used this code many, many times before, and have never had a problem with it. If the document successfully saves, then the form closes. If the save is unsuccessful, the window doesn't close. Simple right?
What is currently happening is that the window is simply closing. The edits are not saved. The users of the application have Author access to the database, and have a role assigned to them. This role ("[CourseEditors]") is explicitly listed in an Authors field on the form. If the user makes an edit and clicks smarticon save button, or manually selects "File|Save", then the changes are saved. If the user makes an edit and then hits the escape key or the "x" on the window tab, the document simply closes without a "Do you want to save your edits" message.
I have run Fixup and Compact on the database, with no luck. I have made a new copy of the datbase, with no luck. I have changed the code under the Save & Close action button from the formula to the following script (also with no luck):
Sub Click(Source As Button)
Dim nuiwsp As New NotesUIWorkspace
Dim nuidoc As NotesUIDocument
On Error Goto ErrorTrap
Set nuidoc = nuiwsp.CurrentDocument
Call nuidoc.Refresh()
Call nuidoc.Save()
Call nuidoc.Close()
ExitPoint:
Exit Sub
ErrorTrap:
Resume Exitpoint
End Sub
When I turned the debugger on and stepped through the code, no error occurred. The "Call nuidoc.Save()" line appeared to have processed, but the changes were not saved.
When I test this using MY id, it works as expected. I have Manager access to the database, and have the same roles as the normal users.
Any ideas? I've been working on this for close to 30 hours and my brain is getting fried.
I have also posted this question on the ldd forum.
-Devin.
Comments
HUGE thanks to Mark Landry for quickly nailing the cause of this problem. If it had been a snake it would have bit me. (Of course, if it had been a snake, I wouldn't have been looking for it.)
Mark's answer is on LDD at: https://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/033dd310ffffd14785256ff000621e92?OpenDocument
-DevinPosted by Devin At 02:44:37 PM On 04/27/2005 | - Website - |