The document is not in the view Error in Lotus Script

Hi,

I am looping through some doucments. When the script comes at set doc=v.getnextdocument(doc) then I am getting… “The doucment is not in the view” Error. What could be the reason for this. I have all documents in that view only… Any help would be appreciated.

Cheers

Pankaj

Subject: The document is not in the view Error in Lotus Script…

can u post ur code for better understanding ?

Subject: The document is not in the view Error in Lotus Script…

Hi,

Thanks for all of ur responses. I got it fixed. I am calling script library from loop. since the document name is the same in the script library I am getting this error. I used document collection class(getalldocumentsby key). Its working fine now.

Thanks again for your responses

Cheers

Pankaj

Subject: RE: The document is not in the view Error in Lotus Script…

There seems to be something going on with this “getNextDocument” going on in R6.5 when used in the loop, though it is fixed here for some reason. It works fine in R5. But fails when the view is saved in R6 and opened in R5 and the agent is still R5 based. May or may not process documents or if processed, fails after processing 5 or 15 or 30 etc… documents without completing, at a stretch. But seems to work without any problem, if I use viewentrycollection and process documents in that collection.Did anyone observed this kind of weird thing when using the applications between R5 and R6 development. (Eg. Saving the view in R6.5 and the agent may/may not be saved in R6.5 but may be in other versions (R5.10), starts failing at that getNextDocument, getPrevDocument lines in the code)

Subject: The document is not in the view Error in Lotus Script…

A guess: Maybe your code is changing the doc so that it no longer satisfies the view selection criteria.

For instance, let’s say your view is all documents where a certain field is not blank. If your LotusScript code empties the field then the doc will no longer appear in the view. When you use the doc as a reference in doc=v.getnextdocument(DOC), it can’t find DOC in the view, so it produces the error.

Subject: And the solutions is to set: NotesView.AutoUpdate = False before processing the view.