I need to refresh all the documents in my Lotus Notes database via a background agent. When I try to use the @Command()...
in the agent with a target of all database docs, the agent counts through them all -- but shows this error message:
Formula Error: @Command and other UI functions are not allowed with this type of search; please select None.
When None is selected, it comes back with 0 found. I assume there must be another way to do this. Do you have any suggestions?
I'm not certain what you want to do when you 'refresh' the documents. If you want to recalculate the values in a form for each document, you can use the doc.ComputeWithForm method to recalculate each document with the appropriate form, and then save the document. Beware of this method though, because all validation formulas will also be triggered; and if there are errors, it will cause problems.
The best thing to do is to create the code to walk a view of the Lotus Notes documents that need to be 'refreshed,' and perform the needed calculation. For example, if you have a field on a document called DaysOpen, our agent could walk the view of open documents and perform the calculation on the appropriate documents.
Do you have comments on this Ask the Expert Q&A? Let us know.
Dig Deeper on Lotus Notes Domino Agents
Related Q&A from Brian Mahoney
Find out what types of calculations can be computed for a column in a Lotus Notes view and the best way to go about it with this expert response. Continue Reading
Find out why you can't use Formula language to include a doclink to a specific Lotus Notes view or database and need to use LotusScript instead. Continue Reading
Discover the reasons behind a Notes/Domino admistrator having trouble with disabled options in the "customize this view" section of his Lotus Notes ... Continue Reading