Display agent data in view

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?

Subject: Display agent data in view

Not in any real sense, unless you’re setting something identifiable in ProcessReadyForEAS. All you have to go on is the StatusNum field value, $UpdatedBy and $Revisions if the code simply checks values and sets the StatusNum field, and while the data for the change will live in $UpdatedBy (“who”, being the agent signer or server) and $Revisions (“when”) until they are forced out by subsequent updates (if the fields get too large, older values will be dropped), there isn’t a one-to-one correspondence between those two fields, so you can’t reliably match a “who” to a “when” if the document is touched after the status is updated. You would need to have (at least) a field recording the status change date(s), or to add the agent status updates to your current list.

Subject: RE: Display agent data in view

Thanks for the quick response! I will see what I can do! Much appreciated!!