I changed an action button 'into', so when some user press this button I just save the Uidoc. I would like to delete this document considering the fact that if I do not delete it all documents will be saved on ALLdocument views!
When I try to delete the document (call doc.remove) i receive the error message: "Cannot remove notesdocument when instantiated by NotesUIDocument", all this in another action button of the doc.
Also, I would like to close the NotesDocument. I also tried something like:
@Command([movetotrash]);
@Command([emptytrash]);
@Command([fileclosewindow]) but it doesn;t work. Thank you, Samir Akhtubir
I tried smth like this, too:
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
noteid$ = source.document.NoteID
Delete source
Dim S As New notessession
Dim db As notesdatabase
Set db = s. currentdatabase
Dim doc As Notesdocument
Set doc = db.GetDocumentbyID(noteid$)
Call doc.Remove(True)
End Sub
But if I put this code into the doc that has just been created, all the docs will be deleted. Then I putted into the QueryClose of my action button called 'Cancel' but it isn't working.
So, how can I delete a current document and close the window in an action button?