I have a database that imports a large number of assets (around 28,000) through an import agent. The agent imports the assets from a CSV file. Once the assets are in the database, I run another agent to find who is responsible for each asset. I think the agent that looks up the responsible party is timing out because the agent works perfectly on a smaller scale version (20 assets).
Can someone let me know if there is a timeout on this type of agent and how I can get around it? Or could someone let me know if it’s the code itself? I’m not exactly a script pro, I just know enough to be dangerous.
The script for looking up the person responsible is below.
Thanks!
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As notesuidocument
Dim ws As NotesUIWorkspace
Dim vw As NotesView
Dim coverage_vw As NotesView
Set db = session.currentdatabase
Set vw = db.GetView(“Current Universe”)
Set coverage_vw = db.GetView(“Coverage”)
Set doc = vw.GetFirstDocument
Const NotesMacro1$ = “@GetProfileField(‘db profile’; ‘RTP_focal’)”
RTP_focal=Evaluate(NotesMacro1$, doc)
Const NotesMacro2$ = “@GetProfileField(‘db profile’; ‘Pgh_focal’)”
Pgh_focal=Evaluate(NotesMacro2$, doc)
Do Until Doc Is Nothing
'check for RTP assets
If doc.Asset_Work_Loc(0) = “USSMB” Then
If doc.Asset_Bldg_num(0) = “500” Then
doc.Asset_Focal = RTP_focal
Call doc.Save( False, False )
End If
If doc.Asset_Bldg_num(0) = “501” Then
doc.Asset_Focal = RTP_focal
Call doc.Save( False, False )
End If
If doc.Asset_Bldg_num(0) = “502” Then
doc.Asset_Focal = RTP_focal
Call doc.Save( False, False )
End If
If doc.Asset_Bldg_num(0) = “503” Then
doc.Asset_Focal = RTP_focal
Call doc.Save( False, False )
End If
End If
'check for Pittsburgh assets
If doc.Asset_Work_Loc(0) = “USPTT” Then
doc.Asset_Focal = Pgh_focal
Call doc.Save( False, False )
End If
'lookup focal points for each AIM site
If doc.Asset_Focal(0) = “unknown” Then
Key = doc.Asset_Site(0)+“-”+doc.Asset_Rcostctr(0)
Eval = PerformDbLookupLS(coverage_vw,Key,2)
If Eval(0) <> “” Then
doc.Asset_Focal = Eval
Call doc.Save( False, False )
End If
'lookup assets owned by customers
If doc.Asset_Focal(0) = “unknown” Then
If doc.Asset_Loc_Type(0) = “C” Then
doc.Asset_Focal = “Customer Asset”
Call doc.Save( False, False )
End If
If doc.Asset_Bldg_Num(0) = “CUST” Then
doc.Asset_Focal = “Customer Asset”
Call doc.Save( False, False )
End If
End If
'lookup assets owned by vendors
If doc.Asset_Focal(0) = “unknown” Then
If doc.Asset_Loc_Type(0) = “V” Then
doc.Asset_Focal = “Vendor Asset”
Call doc.Save( False, False )
End If
End If
'lookup loaner assets
If doc.Asset_Focal(0) = “unknown” Then
If doc.Asset_Loc_Type(0) = “L” Then
doc.Asset_Focal = “Loaner Asset”
Call doc.Save( False, False )
End If
End If
End If
Set Doc = vw.GetNextDocument(Doc)
Loop