What-If Analysis

I have a simple Notes database that tracks projects. There is one view that shows all projects that are currently “overdue”. I’ve been asked to provide another view that will allow the users to see which projects will be overdue as of a date that they select. I would prefer not to modify the existing form/documents but I don’t know how else this can be done. Can anyone offer any suggestions?

Subject: What-If Analysis

Dave,

I prefer to use a report-style agent. So I have a button in the view that calls an agent. The agent asks for a date, in your case, and perhaps other criteria, and then gets a collection of docs that meet that criteria.

It then populates a rtfield in a report document with a summary line and doclink (sort of like a newsletter).

What I like is that it’s easily mail forwardable and printable, it doesn’t have any issues with shared folders/views, doesn’t require a private view, etc. And it’s relatively fast and easy for the user.

regards,

raphael

Subject: What-If Analysis

Thanks to all. It’s great to read different thoughts/implementations. I appreciate all of your time and help.

Subject: What-If Analysis

Yup, use the PostOpen event on the view. Below is a sample that I knocked together for one of my apps, it should be fairly self explanatory:

Sub Postopen(Source As Notesuiview)

'Prompts user for beginning and ending dates

'Changes selection formula to display docs between dates

Dim uiw As New NotesUIWorkspace

Dim ss As New notessession

Dim uiview As NotesUIView

Dim view As NotesView

Dim formula As String

Dim one As String

Dim two As String

Dim ct As Integer

one = uiw.Prompt(Prompt_OKCANCELEDIT,"Enter the starting date",   "Start Date (use format DD/MM/YY)","")

two = uiw.Prompt(Prompt_OKCANCELEDIT,"Enter the ending date",   "End Date (use format DD/MM/YY)","")



formula = |SELECT Form="Employee" & EmployeeStatus !="Leaver"  & !(@IsAvailable($Conflict))& !@IsResponseDoc | 

formula = formula + | & lastReviewed > [| & one & |] & lastRevieweD < [| & two & |]|



Set uiview = uiw.CurrentView

Set view = uiview.View

view.SelectionFormula = formula

Call uiw.ViewRebuild

ct = view.EntryCount

Messagebox "The number of docs in this view = " & ct,,"Count of docs in view"

End Sub

Sue

Subject: RE: What-If Analysis

There are a couple of caveats to this approach:

because of the risk of concurrent modification, the view being manipulated needs to be a private view (which entails a few minor challenges in itself)

it’s not very scalable . . . as the document count of the database increases, performance will decrease

An alternative might be to generate a spreadsheet of some sort to display the requested data . . . or perhaps a calendar view that shows projects by their due date.

dgg