This is related to an earlier post: http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/e26e8997d98f7fa785257b98004f47bf?OpenDocument
it is pulling the correct processed date for the documents that are not put into Hold status. This is because there is not a status the user is changing but rather system generated so this last processed date will only show the last status done by a user.
I have an agent that moves documents from “Hold” status to “Ready for EAS” 14 days before the Invoice Due Date (on Hold Release date).
The "HoldReleaseDate field formula:
REM {If due date is on weekend (7 or 1), get to the previous friday, then subtract 14 days to get the date we want to release the hold};
dtDue := InvoiceDueDate;
dayDue := @If(dtDue = “”; 0; @Weekday(dtDue));
wkendAdj := @If(dayDue = 7; -1;dayDue = 1; -2; 0);
totalAdj := wkendAdj - 14;
@If(dtDue = “”; “”; @Adjust(dtDue; 0; 0; totalAdj; 0; 0; 0))
This is the agent script:
Sub Initialize
'Move any reqs that are in Hold status (StatusNum = 7) to Ready for EAS (StatusNum = 8) if their HoldReleaseDate has been reached
'NOTE: This should run before the 'Extract Attachments for CM' agent daily
On Error Goto Err_Init
Dim s1 As NotesSession
Dim currDB As NotesDatabase
Dim doc As NotesDocument
Dim col As NotesDocumentCollection
Set s1 = New NotesSession
Set currDB = s1.CurrentDatabase
count = 0
'get all docs with StatusNum = 7 and HoldReleaseDate that is today or has passed (in case we missed it)
Set col = currDB.Search({StatusNum = 7 & HoldReleaseDate <= @Today}, Nothing, 0)
Set doc = col.GetFirstDocument
While Not( doc Is Nothing )
ProcessReadyForEAS doc
Call doc.Save(True, False)
count = count + 1
Set doc = col.GetNextDocument( doc )
Wend
Call LogEvent("Agent Completed Successfully. Moved " & Cstr(count) & " reqs to Ready for EAS status.", SEVERITY_LOW, Nothing)
Exit_Init:
Exit Sub
Err_Init:
On Error Resume Next
Call LogErrorEx(Error$, SEVERITY_HIGH, Nothing)
Resume Exit_Init
End Sub
Is there a way to get the date processed for the Hold documents to display in a view?