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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ArunkumarCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.