Agent

HiI have created an agent (thanks to david, matt and pete for help)

he makes one doc out of two! He takes 5 fields from one doc and 10 form the other one and creates a new document out of it!

He runs on 1800 documents!

How long will it take for him to complete?

sommetimes I get an error message network time ran out when i save some views can this hapen in this case??

Thanks

Branimir

Subject: Agent

Hi.,If there are 1800 documents.it will not take much time. This also depends on the type of data you are copying or may be the coding is going into infinite loop.

You can try debugging this by keeping the print of the count to track the time taken to copy two docs into one doc.

BR//

Subject: Agent

I agree with Naive User.In your code put a “Print” statement, eg:Print "Creating Doc - " + Cstr(cnt)

Put this inside your loop so it prints each time it creates a new doc.

This will display the count in the lotus notes Status bar, so you can see it physically going through each doc. Possibly put some more information in there like document name. This way you will be able to identify if it is getting stuck on one doc in particular.

Subject: RE: Agent

Again, I agree as well. However, if you are going to somehow put this code into a background agent, you might not want to do a print statement for each document, as it will post 1800 lines to your log.nsf file, which might be counterproductive. You could instead do something like:

In the DIM statements:

dim count as long

Then before your loop:

count = 0

then inside your loop:

count = count + 1

then during your loop:

if count mod 1000 = 0 then

print cstr(count) + " documents processed"

end if

and finally right after your loop:

print “finished processing " + cstr(count) + " documents”

Another thing you could do would be to set up a time counting function, so after it runs, it will tell you how long the agent took. Search the forum for code snippets by searching for “timedifference”

Good luck.

  • Matt