Set view = db.GetView("viewname") Set entrycoll = view.AllEntries Call entrycoll.StampAll("fieldname", value)
However, if you're updating more than one field, it probably is more efficient to iterate through the documents using view.GetFirstDocument and GetNextDocument. Use view.AutoUpdate to prevent the view index from being updated while you do your loop; if you delete documents, your loop should pre-fetch the next document at the top of the loop.
If the column is the first sorted column in the view, they you can easily find the largest one using view.GetFirstDocument or GetLastDocument (depending whether the sort is ascending or descending).
Otherwise, the quickest way to iterate through a view looking for the maximum value is to use an entrycoll variable, as shown above, and iterate thru the rows examining the ColumnValues property. Using a view that's already sorted is a lot faster, so it might be worth while to have a hidden view with this sort, if for no other reason.
Macro language does not offer an efficient way to do either of these tasks. While @Max(@DbColumn(...)) will work in some cases, you still have to retrieve all the data in a column, and there's a limit to how much data @DbColumn can return.
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on LotusScript
Related Q&A from Andre Guirard
Learn how you can use LotusScript and OLE to create and populate Microsoft Excel spreadsheets, as well as a little bit about Lotus Symphony. Continue Reading
Discover options you can use if you'd like external users to be able to access a workflow-based Notes Domino application through different ... Continue Reading
When Notes/Domino developers say they want to "update the fields" in tha Lotus Notes view, they usually mean that they want to cause computed fields ... Continue Reading