Pickup Documents > 6 months Old

Hi There,

Could anyone confirm that the following formula will only pick up documents that are greater than 6 months old and are closed?

tempTD:= @Adjust(@Now;0;-6;0;0;0;0);

SELECT ((Form = “FLS Call”) & Status = “Closed” & @Created < tempTD)

Thanks

F1H

Subject: Pickup Documents > 6 months Old

Yes

Is this a view selection formula? If so, using @Now (or even @Today) is not the best course of action.

Subject: RE: Pickup Documents > 6 months Old

I have heard its not the best way, but I dont know any better :((

Can you give me an example of a better way of doing it?

thanks

F1H

P.S> this is a view selection

Subject: RE: Pickup Documents > 6 months Old

Create a scheduled agent, running each night, set a new field to the value “1” on docs that are more than 6 months old and whatever other criteria you need.

In your view, select docs that has the field = “1”.

/Peter

Subject: RE: Pickup Documents > 6 months Old

Since you are concerned with 6 month intervals and not up-to-the-minute updates, I have heard of one solution that runs an agent at midnight on all potential documents that would appear in that view and stamps all those documents with the current date. Then, your view selection can just compare @Created against this date stamp - @Now or @Today are not required.

You would probably need to modify the view selection to include documents that are “Closed” but that do not have the date stamp field yet (those closed within the current day) and you may need to run another agent as you roll this out to make sure the view starts out by selecting the documents correctly even before the scheduled agent runs at midnight for the first time.

Subject: RE: Pickup Documents > 6 months Old

Instead of running an agent that checks all documents and may modifying a noteworthy number of them, wouldn’t it be better to modify only one document? The design note for that view?

Using a nightly LotusScript agent, you can set the selection formula to use a specific cut-off date. Works extremely well.

Subject: RE: Pickup Documents > 6 months Old

Think i will try to edit the view selection formula to include the date for six months ago, nedd a bit of help tho…

here is what i have :

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim v As NotesView

Dim formula As String

Dim dateTime As New NotesDateTime( Today )

Call dateTime.AdjustMonth( -6 )

Dim strDate As String



Set db = s.CurrentDatabase

Set v = db.GetView("ArchiveView")



strDate = Cstr(Cdat(dateTime))



formula = "SELECT Form = ""FLS Call"" & @Created <"

v.SelectionFormula = formula

End Sub

I am getting a Type mismatch when i try to convert the adjusted date into a string to pass into the formula, can anyone help?

Thanks

f1H

Subject: RE: Pickup Documents > 6 months Old

Try this - literaly - as formula:

formula = |tempTD:= @Adjust(| & Now & |;0;-6;0;0;0;0);

SELECT ((Form = “FLS Call”) & Status = “Closed” & @Created < tempTD)|

Alternatively you could do the adjustment in script. Or I could do it, but I’m too lazy. :slight_smile: This is the easiest way to write it down and it should work.