View refresh lotusscript - Issue Cause!

Hi All,

An application module was working fine. It used to update dates from one document ( say doc 1 ) to another document ( say doc 2 ).

What the code does is, once the “doc 1” is saved, it get handle of the view in which “doc 1” updates. From that view, it gets the “doc 1’s” new updated dates and does some compuation with it and saves the “doc 2”.

What is it that I’m facing here is, I’m not able to retreive the latest dates saved in “doc 1” from the view. I have tried - AutoUpdate, Refresh. Doesn’t work. FYI, this entire module is in an external script library function. So, we are here doing a call to that function.

When we use/ copy that external function in the same agent internally, it works fine. Can you pls help in communicating the issue cause, if by any chance, had you ever gone through this.

Thanks !

Subject: There are two things you can do

For simple operations on a document that affects its continued presence in the view that you are looping through, you must set the next document before doing that action.

The code would then look like this:

Set doc = view.GetFirstDocument

While Not (doc Is Nothing)

… Set nextDoc = view.GetNextDocument(doc)

… ’ – do your actions

… Set doc = nextDoc

Wend

If your actions affect not only the current document but also other documents in the view, it is better not to work with the view at all but with a collection of documents, which can be accessed in two ways:

… using db.Search() → a document collection

… using view.AllEntries → a collection of view entries, each containing a document.

Subject: You need to post some code…

I dont think anyone can help much without seeing what the code is trying to do.