ViewRefresh Method

I have a LotusScript agent which runs against selected documents in a view. The following lines execute after the documents have been modified and saved:

call view.Refresh

call workspace.ViewRefresh  

After the agent runs, computed fields on any document do not show updated values assigned by the agent unless the document is edited and refreshed using the F9 key. The view in which the agent runs is set to refresh on ‘Auto,after first use’. Is there any reason why the ViewRefresh method is not refreshing the computed fields while the agent runs?

Thanks.

Subject: Try executing notesdoc.ComputeWithForm(True, False) before notesdoc.Save(True, False)

Subject: Please don’t… re: Try executing notesdoc.ComputeWithForm(True, False) before notesdoc.Save(True, False)

If you’re going to use notesdoc.ComputeWithForm, be sure to set the raiseError parameter to True, not False. If you don’t, any errors in your form calculations will generate error codes in your fields, which will prevent proper execution of the ComputeWithForm. You can really trash your data this way.

Subject: OK, but it can also keep computing the rest fields even if 1 fails.

Subject: RE: OK, but it can also keep computing the rest fields even if 1 fails.

Yes, but it will store Error values in that field, often resulting in documents which cannot be opened through the regular UI.

Subject: Not anymore. Try it. Create a form with 1 field Default Value @Error, Design Preview in Notes.

It no longer prevents the UI from opening.

Subject: RE: Not anymore. Try it. Create a form with 1 field Default Value @Error, Design Preview in Notes.

Fine. I still think it’s a terrible idea to architect a solution that stores bad data in documents. We can debate the effects of this until the cows come home. But NotesDocument.ComputeWithForm (true, false) is a line of Lotuscript that causes me to delete entire applications and salt the ground on which they were grown until those developers learn how to debug software.

Subject: My cows are coming home :-). I’ll agree not to debate this anymore.