UnprocessedDocuments - Agent processes the same document every time it runs

Hello,

I created an agent to process all selected documents in a view, and sometimes when I trigger this agent just after having triggered it, it tries to process the same document that was processed before.

Follows the agent code:

Set coll = G_db.UnprocessedDocuments

Set doc = coll.GetFirstDocument

doc.TrashTracker = G_user & “–” & dt.LocalTime

doc.HistoryLog = doc.HistoryLog(0) _

	& Chr(10) & Chr(10) &

	dt.LocalTime _

	& Chr(10) & "         ----> Document DELETED by " & G_user

doc.Save True, True

Call G_ses.UpdateProcessedDoc( doc )

Why is this happening? Does anyone know how to fix this problem?

Thanks in advance,

Aline

Subject: selected documents

If you have the agent to run against selected documents it will do that - doesn’t matter if you’ve set them to processed, if they’re in the view and selected then it will perform the action against them

There’s also a possibility that even if they’re removed from the view they’re still selected (can’t remember the exact scenario).

At the very least do a workspace.refresh to update the view, you may also need to do a notesuiview.deselectall

Subject: selected documents

That worked perfectly!

Thanks a lot!

Best regards,

Aline