Processing documents in a view

Hi,

I’ve a view which holds the employee documents (with items like SSN, TerminationDate etc.) that are ready to process by a daily scheduled agent. There may be duplicate documents for a given SSN ( as it may be submitted by Manager and admin asst etc.). But the agent should process only the most recently submitted document for a given SSN and move out the duplicates from that view.

Please let me know the design consideration?. I’m thinking in the lines of using a LotusScript list of documents…

Thanks in advance.

Adi

Subject: Processing documents in a view

Here’s one way you could do it. Have the view’s first column be the submitted date, and sort it descending.

Dim db as notesdatabase

Dim v as notesview

Dim doc as notesdocument

Dim ssn as string

Set v = db.getview(“yourView”)

v.AutoUpdate = false

Set doc = v.getfirstdocument

ssn = “”

While not doc is nothing

If doc.ssn(0) <> ssn then

'it’s the first doc for that ssn; process

ssn = doc.ssn(0)

else

'it’s not the first one; move on

Set doc = v.getnextdocument(doc)

wend