Archiving process opinions sought

I need to set up an archiving process in a custom database. It has about 41,000 documents. Some of those documents have responses.

I know we are encouraged not to use ‘Today’ in a view selection criteria…but as I’m thinking this through I see three options…with pros/cons…what is your vote?

  1. Create a view that includes ‘Today’ in the selection criteria for everything closed more that 2 years ago. Agent runs and archives just those documents (and their responses) in the view.

  2. Create a view that includes ALL documents (not responses) and have the agent wade through them all to decide if they are over 2 years old.

  3. Create a two step process where I run an agent on ALL documents (not responses) to decided if it is over two years old and set a Y/N indicator on the document. Have the view include only documents with Y in the indicator. Second Agent archives all documents in the view (and their responses).

TIA

Subject: Archiving process opinions sought

#1 isn’t a good option - NEVER use Today or Now in selection formula of a view!#2 it’s ok - but processing 41k+ documents could take a really loooooong time and You might end up with a agent timeout (depending on server settings).

#3 it’s a ok option, but not what I would recommend. This would have a huge impact on 41k+ documents and the view indexes etc.

I would suggest another approach…

I would suggest doing something like:

  1. Build a view that has a specified date (Do not use @Today, @Now) - like [2008-01-01] (or whatever dateformat You are using).

  2. Have a nightly agent to modify this views selection formula to a cutoff date that You will decide. Remember that this agent has to be set to run AFTER the nightly design update task.

  3. The same agent will then also force a view rebuild

  4. The archiving agent will then process all documents in this view, since they are older than X years.

Set the archiving agent to run several hours after the view rebuild to make sure that the whole view is correct before processing the archiving.

hth

Subject: RE: Archiving process opinions sought

This is a GREAT idea! THANKS! And I hope someone will still read this day-old post because I think I’m really close…just a syntax problem.

I think I’ve tried every combination of (){}| that I could think of … I want the selection formula to end up with the actual date I calculated in it…tempToday calculates to 11/4/2006 but how do I pull it into the selection formula to post it back in the view?

Dim tempToday As New NotesDateTime(Today)

Call tempToday.AdjustMonth(-24)

Formula = {TheClosedDate := @If(ReClosed = “”;Closed;ReClosed); SELECT form = “ABC” & (TheClosedDate < @TextToTime(tempToday)}

Subject: SelectionFormula SOLUTION

After trying many combinations of special characters, it seems that dates get confused if you do NOT use quotes to surround the whole select statement. Then you need double quotes on anything within the select statement.

Here I want to change the selection criteria on a view weekly via a scheduled agent. This is to avoid having a view with @Today or @Now in it. I want to include a particular form (ABC) that has a closed or reclosed date that is older than 2 years (730 days). I will then run an agent that will archive everything (and their responses) in this view. HTH someone else too!

Sub Initialize

Dim session As New NotesSession

Dim db As notesDatabase

Dim view As NotesView	

Dim Formula As String		

	

Set db = session.CurrentDatabase      	

Set view = db.GetView("Archive View 2")     

	

Formula = "TheClosedDate := @If(DateReClosed ="""";DateClosed;DateReClosed); SELECT form = ""ABC"" & (TheClosedDate < [" & (Date - 730) & "])"

view.SelectionFormula = Formula	

End Sub