Solved

Code freezing system

Posted on 2006-11-30
3
212 Views
Last Modified: 2013-12-18
Have the code below in an agent, this agent is triggered by a button, the agent is set for selected docs and is triggered while in a particular record. It is sending the tracer needed, but for some reason it is freezing up my system. Is there something I have wrong in here which would freeze everything up like that.

Joe


Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim emaildoc As NotesDocument
      Dim Item As NotesItem
      Dim twoliner As String
      Dim rtitem As NotesRichTextItem
      Set db = session.CurrentDatabase
      Set col = db.UnprocessedDocuments
      Set doc = col.GetFirstDocument
      On Error Resume Next
      While Not doc Is Nothing
            If doc.input_flag(0)<>"done" Then
                  Set emaildoc = db.CreateDocument
                  emaildoc.form = "bb_input" 'Form name of Letter
                  emaildoc.SendTo = doc.EE_Name(0)
                  emaildoc.Principal = "Field Technology"
                  emaildoc.Subject ="Order for " +  doc.name_adjusted (0)+ " has been forwarded for processing."
                  Call emaildoc.Send(True)
                  doc.input_flag = "done"    'field name for flag
                  doc.status = "Order Input"
                  Call doc.Save(True,True)
            End If
      Wend
End Sub
0
Comment
Question by:jforget1
  • 2
3 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 18047880
your loop
While Not doc Is Nothing is always going run.

You need to exit somewhere !

I hope this helps !
0
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 18047889
Add in a   doc = col.GetNextDocument(doc) before the Wend somewhere

0
 

Author Comment

by:jforget1
ID: 18047976
As always right on the money. Thanks for the help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now