How to make this refresh indicator work?

I designed a view in a Notes database and appled formula SELECT today_date = @Today & status = "Done". But @Today causes the view refresh indicator to display constantly. I changed @Today to @Date(@Now) and it didn't work either.

How to select a view with one field having the value of today's date?

Jzzhang
LVL 2
jzzhangAsked:
Who is Participating?
 
ArunkumarConnect With a Mentor Commented:
Hi jzzhang,

You cant hide the refresh icon from the view when you use @Today Function.  This is documented in the notes help. (SEE CONTENT)

:(
Arun


From the Notes HELP of @Today Function..

@Today

Returns today's date.

Syntax
@Today

Return value
today Time-date. Today's date.

Usage
This function is identical to the formula @Date(@Now). It is usually used in default value formulas to automatically enter the current date.
Using @Today in column or selection formulas may impact the efficiency of your application.

==================================
It also causes the view refresh indicator to display constantly.
==================================
0
 
jzzhangAuthor Commented:
Arunkumar,

I know @Today will cause the refresh indicator to display constantly. I am looking for a solution for a view to display all the documents with one date field equal to today's date. And the refresh indicator should not always display.

Jzzhang
0
 
ArunkumarCommented:
Hi,

You cannot do that on a view without a @Today function.  

I can suggest you something interesting.  Create a folder.  Run a scheduled agent every 30 minutes that will make a collection of documents using the @Today function.  Put all this collection in that folder.

you can use the db.Search with a view selection formula as a parameter.

:)
Arun

PS:  Dont forget to refresh the folder.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
jzzhangAuthor Commented:
Excellent! But it seems that there is no way to put all collected documents to a view rather than to a folder. It would be nice to put them to a view. But it is also acceptable to put them to a folder. I am thinking if there is a way to put some formulas or scripts on the view selection.

Arunkumar, please let me know. In either case, I will accept your answer which is a good solution for this kind of problem.

Jzzhang
0
 
ArunkumarCommented:
OK,

Take the collection,  Add a field to all the documents with a flag value.

Create a view with selection formula with this flag value and refresh the view.

But dont forget to remove these fields from the document everytime you do because, when you dont turn off the flag this document is going to stay there forever.  

So, Design view first with a flagged value.  Your script should first take all the documents from this and reset the flags to null.  Then take a collection of documents from the database include the flag value and save the documents.

Good Luck !

:)
Arun

PS:  For efficient performance you can take two collections, One for removing the flag (based on the flag) and the other one for including the flag (formula based on the @Today Function)
0
 
jzzhangAuthor Commented:
Thanks, Arunkumar.

Doing folders is OK for this task. But it would be nice to list the folder under the view. Also, I think I need to delete outdated documents in those folders before I copy all the required documents into those folders. Here is the source code of the agent. I am looking for a script formula to delete all the files in a specified folder.

*****
Sub Initialize
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim doc As NotesDocument
     Dim dc As NotesDocumentCollection
     Dim collection As NotesDocumentCollection
     Dim dateTime As New NotesDateTime("01/01/94")
     Set db = session.CurrentDatabase
     Set dc = db.AllDocuments
     
     searchFormula$ = "today_date = @Today & status=""Done"""
     Set collection = db.Search( searchFormula$, dateTime, 0 )
     Messagebox Str(collection.Count)
     Call collection.PutAllInFolder("1. Today\1. Done")
End Sub
*****

Jzzhang
0
 
jzzhangAuthor Commented:
Arunkumar, I think I have to turn to view solutions since if I modify one document in a folder, it wouldn't show up to the other folder having the same file.

Jzzhang
0
All Courses

From novice to tech pro — start learning today.