2
votes

I changed property of few form fields in my lotus notes database. There are 1000+ documents in the database. To reflect that field property change if I open each document and and then Save and Close it, the field is getting updated. But doing it manually for each and every 1000+ documents in not a feasible solution.

I looked into this and found that @command([ToolsRefreshAllDocs]) can refresh all documents in a view. I created an agent with this formula and tried to run it from the view. Unfortunately its not working and giving error "Document left to process xxx, NoteID causing error = xxx". I tried to look for any info on this error, but could not find anything.

Can anyone please help me with this and let me know why this error is coming and how to resolve this. Or is there any other way to refresh all documents in a view so that fields get updated for all the documents.

Thanks

1

1 Answers

3
votes

You have an input validation formula or a computed value formula set up for a field on a form for documents in the view. The refresh is causing that formula to execute, and it is failing. This might be related to the property that you changed, causing a formula that depends on the field to fail for some of the documents even though it works fine in the documents that you've tested manually. It might not be related to the property that you changed, as it might just be a document that would have failed a refresh even before you made that change.

This is difficult to track down manually. One technique that I used for this in the early days of Notes was to create two folders. Move half of the documents to one folder, and half to another. Try your refresh agent in both folders. If they both fail, you have at least one document with a problem in each folder. Make two more folders and split into four group, then try your refresh again in each folder. Keep dividing the documents and refreshing. Any time you get a folder where your refresh agent runs correctly, you know all the documents in that folder are good. Keep dividing and refreshing folders where you get the error until you're finally down to just one document in a folder.

Needless to say, this brute force divide-and-conquer approach is not fun when you have large databases with thousands of documents. Fortunately, there is a better way. You can write a LotusScript agent that loops through the documents in your view and calls doc.ComputeWithForm(true,true), checks the boolean return value and sets an item value (e.g., debugItemFailed to "1" for each document where that value was false. Then make yourself a new view using SELECT debugItemFailed = "1" and you will see all the documents where you have a validation or computed field problem.

And this, by the way, is why I haven't used [ToolsRefreshAllDocs] in any production database in a long time. I always use a LotusScript agent that calls ComputeWithForm.