Domino Code Fragment

Code Name*
Removing Old Documents with an Agent
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.217.8.82
Description*
This set of Agents will update the database removing old documents. Because of the nature of background Agents, the second Agent is required to reset the status of each document. (Background Agents only run on those documents not yet processed by the Agent, so the second Agent resets a field, thus making it "new" to the first Agent on the next periodic basis) Warning: this will re-set the unread marks in the database!
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Agent 1

SELECT @All;
FIELD FLAG := FLAG;
temp := 8 - @Weekday(@Today);
FIELD a := @Adjust(@Today; 0; -2; temp - 7; 0; 0; 0);
@If(form = "doc"; @If(DocDate < a; @DeleteDocument; ""); "");
@SetField("Flag"; "1")

Agent 2

SELECT @All;
FIELD FLAG := FLAG;
@SetField("Flag"; "0")