I need a agent todo a refresh all field on a form called Leave. Below is my code and i have it on a schedule to run every morning but it does nothing. When i do a test it says no documents modified. Is there something that im doing wrong?
This is in my action code
SELECT
@Command( [ToolsRefreshAllDocs] )
This is in the selection code
uses ‘Leave’ form
Subject: Wrong command
Ross,
Unfortunately, when they use the term “refresh” they mean that this:
“Updates view contents to reflect any updates to the database since the NotesView object was created, or since the last refresh.”
So, it doesn’t cause the documents to re-calculate computed fields, but rather updates the currently open view in the user interface to display the values on those documents. It never modifies any documents and is only useful when used by a user (i.e. not as a scheduled agent).
Did you want to re-compute values on each document? What information is it that you want updated? Perhaps there is a better solution. If you let me know, I can help you walk through some options.
Hope to help,
Dave Navarre
Chub Toad, LLC
Subject: RE: Wrong command
Dave thanks for the help. What im trying todo is refresh a field on a document. The field in set to if (@created = @today ; yes; no) And i have a view thats going off of this field. I know that i can just make the view with @today but i was told that it slows down the indexing. So i need an agent to refresh these fields of these docs (form Leave) every morning.
Subject: View selection formula
I’d go ahead and deal with putting @Today the view selection formula and not worry about the slower indexing. Unless you’re looking at a few thousand documents, the reindexing of the view will consume far less processing power than re-saving all of the documents every day.
Also @Created will never equal @Today, thought @Date (@Created) would. Also, that would only update documents already in the view (so users would need to create them before it runs).
Another option would be for the value to default to “Yes” on the form and for an agent to mark all documents that have “Yes” in the field to “No” at 3am or something like that.
Why do you need to display leave requests only the day they are created?
Dave
Subject: RE: View selection formula
The view is for time cards. I only want the view to display the current date. and there are thousands of docs so i need this to work without the @today
Subject: RE: Wrong command
Why not run an agent early in the morning, say 12:01 AM, to get all the documents in the db in a doc collection and use StampAll to set your field to “No”?
Subject: RE: Wrong command
Actually, that’s not true. The help text you’re quoting is from the LotusScript NotesView.Refresh method. That’s not the same thing as Tools-RefreshAllDocs, which does indeed refresh fields on all documents in the currently-open view. (Yes, I know - the help file lists that @Command as a language cross-reference, but in my opinion it’s misleading, since they don’t actually do the same thing.)
Subject: RE: Wrong command
You are precisely correct about the source of my information. The @Command one also updates the front-end view. My bad.
Refreshing fields is not re-calculating computed fields, so it doesn’t accomplish what he needs to accomplish anyway.
Dave Navarre
Chub Toad, LLC
Subject: Simple Agent ?
According to the Designer Help:
"Refreshes the fields of all the documents in a view or folder.
@Command( [ToolsRefreshAllDocs] )
A database must be open at the view or folder level."
If you’re running it on a schedule, you don’t actually have a database open at the view or folder level - so this is essentially a UI command. You’ll need to find another way to refresh the documents.