I am running my database in a web browser and not through Notes Client.I have a form to create a simple document.
The document is automatically saved when the user clicks “Finished”. The button using the command @Command([FileSave]).
I then have a button called “Delete” which deletes the current saved document being shown. The button is run using an agent called “Delete” also, in LotusScript (Which I nicked this from the Help file):-
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
hm = collection.Count
For j = 1 To hm
Set doc = collection.GetNthDocument(j)
Call doc.Remove(False)
Next
End Sub
This does delete the document.
But when I open another document from a View and use the button it does not delete it.
The documents are in the same state arent’t they? (In saved mode for the agent to work?)
I have checked the log of the Agent and it says “Error: Agent must be run in a View Screen”.
I have added the button into the view screen to delete a document, but the log says the same thing.
Any answers at all?