Empty view said have 2 documents?

After upgrade from R6.0 to R6.03, I notice than one of my scheduled agent do not run. The cause is simple.


set doc=view.getfirstdocument

do until doc is nothing

     'call process in sub routine

     set doc=view.getnextdocument

loop

in R6.0, the agent run smoothly. But in R6.03, it have problem.

If the view doesn’t have any document, or the doc alreadt the last document, the process still be call. In debug mode, I see the doc is there but without any properties.

So, I always have “document already deleted” message when I run the agent manually.

My server have transaction loggin enabled, is this the case?

Help.

Thanks

Subject: Empty view said have 2 documents?

When you say you see the document in debugger but without properties, what you’re really seeing is an uninstantiated declaration of a document object - basically nothing at that point. I think the real problem here is that you’re missing an argument in your last line. The getNextDocument method of NotesView requires a document be passed to it in the argument.

Subject: RE: Empty view said have 2 documents?

I don’t believe he’s missing an argument in his actual code, because it would cause an error (either in the compiler or when making the call) rather than returning Nothing. He obviously didn’t post his actual code. So further speculation about what might be wrong is probably pointless.

Subject: Sorry, mistype…

Sorry, mistype…

This is my original Script

Do Until docSOActive Is Nothing

Call docSOActive.PutInFolder(“TempDoc”)

Set docSOActive=viewSOActive.GtNextDocument(docSOActive)

Loop

Set docSOActive=Nothing

When I said the doc is there in debug mode, I can see the doc, but when I get more detailed thereis no other properties. There is even no noteID.

So I change a little in the program to

Do Until docSOActive Is Nothing Or docSOActive.noteid=“”

Call docSOActive.PutInFolder(“TempDoc”)

Set docSOActive=viewSOActive.GetNextDocument(docSOActive)

Loop

Set docSOActive=Nothing

That works.

But funny, I have others agent that use the same loop pricipal, but they still works?

Subject: RE: Sorry, mistype…

This line:

Do Until docSOActive Is Nothing Or docSOActive.noteid=“”

will fail if the value of docSOActive is ever Nothing, because both parts of the “Or” are evaluated regardless. So you haven’t really solved the problem.

Your “original code” contains a typo. Is that your actual original code, copied and pasted from the agent that was actually not working? Or did you retype it in your message? From your debugging, what is the IsDeleted property of this mystery document?

Why are you not just using NotesViewEntryCollection.PutAllInFolder if this is all you do inside your loop?

Subject: Re: Sorry, mistype…

Yes, my original post have a typo, that why I type it again.

Yes, the loop is just to put all docs to the folder. I never knew that NotesViewEntryCollection object exist, maybe I will try your sugestion (keep on writing lotusscript with R4 :), never try bother to look the new objects)

Subject: RE: Empty view said have 2 documents?

Not sure what you mean, “the doc is there but without any properties.” If it’s a NotesDocument object, it has some properties. The only object with no properties is Nothing. Perhaps you might be more specific about what the debugger is showing you.

I’m confident that the code you posted should still work in 6.0.3. If not, yours would not be the only complaint here, since this code structure is very very very common in agents. I think that something else changed besides the upgrade.

Subject: Empty view said have 2 documents?

set doc=view.getfirstdocumentdo until doc is nothing

'call process in sub routine

set doc=view.getnextdocument

the method getnextdocument requires an argument you do not have. I don’t know if it matters in your problem. You may want to put the code in correctly in your samples though or you will have people wondering if you really know what you are doing.