developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




Schedule Agent
Romel Rivera 03/07/2016 09:40 AM
Domino Designer All Releases All Platforms


I have a "Pending" view and I want that my Status field will automatically change from Pending to Retention using schedule agent.

This is my code. not work please help.

Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim v As NotesView
Set v = db.GetView("Pending2")

Set doc = v.GetFirstDocument


While Not(doc Is Nothing)
If doc.DaysConsumed(0)>=180 Then
doc.DocStatus="Retention"

Else
doc.DocStatus="Pending"

Else if

doc.ClaimedBy(0)<>"" Then
doc.DocStatus="Claimed"

End If


Call doc.Save(True, False)
Set doc = v.GetNextDocument(doc)


Wend

End Sub

Go back