Subject: RE: Problem refreshing values in a view
Um, that would help – if it doesn’t work for you I’m not sure why. It would produce poor performance in that view.In general, when you have a view index, the index is stored on disk. When you use the view, Notes only looks at documents that have changed since the view was last used, to see whether they belong in the view and to recalculate their column values. If the document has not changed, Notes doesn’t bother to re-evaluate the column formulas, but uses the stored values.
If you use @TextToTime(“@Today”), you are fooling the view indexer into not recalculating values that might be out of date.
There are several different approaches to making something like this work:
Use @Today without @TextToTime and accept the performance hit.
Use @TextToTime, but do something to discard the view index every day at midnight, so that the first person who opens it the next morning has to wait while the data are recalculated. There’s a server console command to do this, and you can talk to your admins about setting up such a command to run. Problem is, this has to be done for each replica, and it’s hard to arrange for local replicas.
Hard-code the date into the view design, and add a daily agent that updates the view design to contain the correct date in its formulas.
Write an agent to run nightly and update documents to contain the desired column value in a field (this is generally a better option for things that only change once; you don’t want to modify every document every night). You would also need a computed field in the documents, so that documents edited during the day would show up in the view.
Don’t use a view; use a folder, and have a nightly agent (or view queryopen code) to update the folder contents. This is a bit more of a challenge if documents might be added during the day because, of course, the view doesn’t update itself automatically; that’s where the queryopen code comes in.
In cases where you want a view selection of one day’s documents, you can have a view categorized by date and display only today’s category.
Not all these techniques are useful in all cases.