Pascal,
i've sent you two emails regarding this and haven't heard back from you. So, I'm posting here.
Just following up to see if you got this - thinking you might be vacationing somewhere.
les
----- Forwarded by Leslie Andrews/Information Technology/MetCt on 08/09/2005 08:15 AM -----
Leslie Andrews/Information Technology/MetCt
08/02/2005 09:21 AM
To
Pascal Monett
cc
Subject
Notes error
I have a problem. I created a process in the Leave Accounting system we use to find specific documents for certain people in our organization. The top administrators (who all work in the Administration Division and have a "Personal Rank" of 4 or 5) have to approve leave for various divisions within the court. However, the views in the leave system are all driven by the department you work in.
So, when I go into the system, it finds that my department is "Information Technology", so when I press the "Pending Leave" button, it opens the "Information Technology Pending Leave" view. So, when the "Pending Leave" button is selected by someone who is assigned to Adminstration and has a Personal Rank greater than 4, my "new" process is run.
This process searches for documents from the past 6 months that are still pending and has the current user as the value in the "Next Approver" field. If a document is found it is placed in a folder which is then opened in a view. However, each administrator uses the same 'Admin' folder, so before I add new documents, I have to empty the folder. This process consistently returns a 'Network Timeout' error. I modified the process a while back to only empty the folder if it had stuff in it and it continually tries to empty even if it is and then still times out.
I don't know what else to try!! Here's the relevant code, if you could look it over and give me any suggestions for improvement, I would appreciate it.
ps - I didn't design this system and only have to take care of it by default (I wrote most of the other Lotus Notes applications used in the court!).
Thanks!
les
Here's the script for the button on the navigator:
and here's the script for the EmptyAdminFolder function:
thanks!
me
i've sent you two emails regarding this and haven't heard back from you. So, I'm posting here.
Just following up to see if you got this - thinking you might be vacationing somewhere.
les
----- Forwarded by Leslie Andrews/Information Technology/MetCt on 08/09/2005 08:15 AM -----
Leslie Andrews/Information Technology/MetCt
08/02/2005 09:21 AM
To
Pascal Monett
cc
Subject
Notes error
I have a problem. I created a process in the Leave Accounting system we use to find specific documents for certain people in our organization. The top administrators (who all work in the Administration Division and have a "Personal Rank" of 4 or 5) have to approve leave for various divisions within the court. However, the views in the leave system are all driven by the department you work in.
So, when I go into the system, it finds that my department is "Information Technology", so when I press the "Pending Leave" button, it opens the "Information Technology Pending Leave" view. So, when the "Pending Leave" button is selected by someone who is assigned to Adminstration and has a Personal Rank greater than 4, my "new" process is run.
This process searches for documents from the past 6 months that are still pending and has the current user as the value in the "Next Approver" field. If a document is found it is placed in a folder which is then opened in a view. However, each administrator uses the same 'Admin' folder, so before I add new documents, I have to empty the folder. This process consistently returns a 'Network Timeout' error. I modified the process a while back to only empty the folder if it had stuff in it and it continually tries to empty even if it is and then still times out.
I don't know what else to try!! Here's the relevant code, if you could look it over and give me any suggestions for improvement, I would appreciate it.
ps - I didn't design this system and only have to take care of it by default (I wrote most of the other Lotus Notes applications used in the court!).
Thanks!
les
Here's the script for the button on the navigator:
Code:
Sub Click(Source As Navigator)
Dim ws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Dim leavedb As NotesDatabase
Dim collection As NotesDocumentCollection
Set uidb = ws.CurrentDatabase
Set leavedb = ws.CurrentDatabase.Database
Dim doc As NotesDocument
Dim session As New NotesSession
Dim maildb As NotesDatabase
Dim mailview As NotesView
Dim UserName As String
Dim dateTime As New NotesDateTime( Today )
Call dateTime.AdjustMonth (-6)
Stop
Set maildb = New NotesDatabase( "Domino1", "names.nsf" )
Set mailview = maildb.GetView( "People" )
UserName = Strrightback(session.CommonUserName," ")+" , "+Strleft(session.CommonUserName," ")
Set doc = mailview.GetDocumentByKey(UserName)
If doc.Department(0) <> "Administration" Then
Call ws.SetTargetFrame("ViewFrame")
Call uidb.OpenView(doc.Department(0) + " PendingLeave")
Else
If Cdbl(doc.PersonalID(0)) >= 4 Then
searchFormula$ = "(Form = ""Leave"" | Form = ""Leave Request"" | Form = ""Vacation"") & NextApprover = """ + session.CommonUserName + """ & (@Contains(Status; ""Pending"") | @Contains(Status; ""Tentative""))"
Stop
Set collection = leavedb.Search(searchFormula$,datetime,0)
If collection.Count > 0 Then
[COLOR=red]EmptyAdminFolder[/color]
Call collection.PutAllInFolder("AdminCollection")
Call ws.SetTargetFrame("ViewFrame")
Call uidb.OpenView("AdminCollection")
Else
Messagebox "You have no pending leave to approve.", MB_OK, "Pending Leave"
End If
Elseif Cdbl(doc.PersonalID(0)) > 0 Then
Call ws.SetTargetFrame("ViewFrame")
Call uidb.OpenView(doc.Department(0) + " PendingLeave")'
End If
End If
End Sub
Code:
Sub EmptyAdminFolder
Dim session As New NotesSession
Dim db As NotesDatabase
Dim folder As NotesView
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set folder = db.GetView("AdminCollection")
[COLOR=green]'this runs even if the folder is empty![/color]
[b]If Not Isempty(folder) Then[/b]
Set collection = db.AllDocuments
Call collection.RemoveAllFromFolder( "AdminCollection" )
End If
End Sub
me