I have a field in my documents that contains a date that is 21 days after the document creation date. I am trying to create an agent that will delete any documents that have reached that age. When I try to use the field selection in the agent with ‘is after’ and a value of @today it changes the @today to todays date. I assume this will then only work for todays date but I need it to use the current ‘today’ for each day the agent is run.
The document has a creation date and an expiration date.
The agent seeks documents in which the expiration date is equal to the current date and deletes it, or
The agent seeks documents in which the creation date is equal to the current date - (“minus”) 21.
Is that correct?
If you use “@today” in a computed field, everytime you edit this document, the field will have the contents changed. To get the creation date use “@date(@created)”.
I believe the second option is “Cleaner”. Only one field needed, computed when composed and with “@date(@created)” in it.
The document has two fields one with the creation date using @created and the other is an epiration date (computed when composed) which is the creation date + 21.
I am trying to get the agent to delete documents where the epiration date has been reached. I have selected the epiration date field and need to say when it is equal to the current date delete the document but when I enter @today in the value field of the agents add condition box it translates to the actual date of today which means that it would only ever work today.
If you are comparing expirydate with today then write a simple condition
if doc.expirydate(0)= today() then
do what ever u want
end if
If u know the no. of days of document to expiry example any number 10 days or 20 days simply take the timedifference between creation date and total no. days of expiry . If this works then remove the expirydate field.
I already have a field that contains the expiry date as this is used and displayed at various times in my application. What I am trying to do is create an agent that will delete the document if the expiry date has been reached.
The view that is used to store expired documents should have a categorized column as its first column, which has the hard-coded value “Expired” (or even “ksdbkbf” for that matter).
Then,
keyName = “Expired” 'or even “ksdbkbf” for that matter