Deleting documents in an embedded view

I have a view in that I have an Agent which I am using for deleting selected documents.

I have embedded this view in a form . although the agent runs in the view but the same when I use for deleting in the form it says the document cannot be saved .

Thanks in advance .

Subject: Deleting documents in an embedded view.

You need to get a handle to the docs using script (and unprocessed docs), something like this - otherwise you’re trying to update the document with the embedded view in it (the agent get’s confused):

Sub Click(Source As Button)

On Error Goto eError



Dim session As New NotesSession

Dim db As NotesDatabase

Set db = session.CurrentDatabase	

Dim workspace As New NotesUIWorkspace	

Dim dc As NotesDocumentCollection

Set dc = db.UnprocessedDocuments	

Dim doc As NotesDocument

Dim nextdoc As NotesDocument

Set doc = dc.GetFirstDocument()

Set nextdoc = doc

Dim uiview As NotesUIView

Set uiview = workspace.CurrentView



Dim dateTime As New NotesDateTime( "" )

dateTime.LSLocalTime = Now



While Not(doc Is Nothing)

'Do Stuff

			Call doc.Save( True, False )				

	Set doc = dc.GetNextDocument(doc)

Wend

exit sub

eError:

Exit Sub	

End Sub

HTH,

Ranjan