Open Standard view to docs with today's date

I have a view that sorts documents by date. What I would like to happen is that when the user opens the view, they are automatically taken to the documents with Todays date.I have tried to utilise the @Command([OpenView];viewname;key) function to achieve this but it appears that “key” must be a string.

Does anyone know of a way to open a view to a particular date-time value?

Subject: Open Standard view to docs with today’s date

Hello William,

I understand that you want to display documents that were created today but, what is not clear is, do you want to display the other documents that were not created today?

Anyways, if you want to display documents created today (and not the older ones), you may give a view selection formula such as

SELECT (@Created = @Date(@Today))

If you want to display all the documents, start with the latest documents first then, you can have a ‘Date/Time’ column in your view (you may hide or display it at your convenience) and sort ‘Descending’ such that latest documents display first and the rest below them.

Regards,

Adi

Subject: RE: Open Standard view to docs with today’s date

Hi Adi,What I have is a view displaying a document for each day for say the next 90 days (so 90 documents) for each user (ie 5 users + 90 docs = 450 docs). The view is displaying all documents all the time, what I want to happen is, that when the user opens the view the document selector is by default placed on the current days document.

That way, locating the current days document is made easier for the user as the view is displaying some roster information graphically in the form of a Gantt chart.

The @Command([OpenView]) function has a go to “key” variable, but this only appears to work for text columns, not date-time.

Subject: RE: Open Standard view to docs with today’s date

Hello William,

The document selector can by default be pointed to one among the three possibilities i.e. in a view

  1. Go to last opened document

  2. Go to bottom row

  3. Go to top row

In the view properties → Options tab (2nd tab from left),

you may select On Open → Go to top row

You may sort the view in descending order i.e. using a Date/Time column so that latest documents are displayed on the top and older ones below.

You may use “Readers” field such that users who ought to see documents related to them may see only those and the sorting and Go to top row setting will automatically point to the top document or top row if you have any categories.

The view would take a lot of time to load though. So, you may use what features are really needed.

Regards,

Adi

Subject: Open Standard view to docs with today’s date

Eventually came up with the following solution in the PostOpen of the view:

Sub Postopen(Source As Notesuiview)

 Dim doc As NotesDocument

 Dim view As NotesView

 Dim dtToday As New NotesDateTime(Today)



 Set view = source.View

 Set doc = view.GetDocumentByKey(Cdat(dtToday.DateOnly))

 If Not (doc Is Nothing) Then

      Call source.SelectDocument(doc)		

 End If

End Sub