Can someone please advise me how to get all scheduled agent names?
I am using
Forall agentname In db.Agents
If agent.IsEnabled = True Then
migdoc.DbAgent=agent.Name
End If
End Forall
I am not able to get scheduled agent names and se to migdoc.DbAgent field.
Please help!!!
amp
Subject: db library agent
Hello, I’ve realised my first solution, so please, try it and give feedback :). will let me know if you find better solution.
Dim s As New NotesSession
Dim db As NotesDatabase
Dim nc As NotesNoteCollection
Set db = s.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = True
Call nc.BuildCollection
Dim note As NotesDocument
Dim nid As String
Dim flag As String
nid = nc.GetFirstNoteId
For i = 1 To nc.Count
Set note = db.GetDocumentByID(nid)
flag = note.GetItemValue("$Flags")(0)
If Instr(flag, "S") Then
Print note.GetItemValue("$Title")(0)
End If
nid = nc.GetNextNoteId(nid)
Next
Dmytro Pastovenskyi
Tips, solutions and development for Lotus Notes Domino, xPages, Java, JavaScript, HTML, CSS, SEO
Subject: RE: db library agent
It does not work, Please help
Subject: RE: db library agent
but it should work, what was the problem in your case? did you go via lotus debuger?
tell me where the error was
Subject: RE: db library agent
It did not bring agent names and set to doc.dbAgent field
Subject: RE: db library agent
look, my code should print the names of schedule angents to status bar, not more…you should change my code as you need.
and you still did not tell which line in my script gave error
Subject: RE: db library agent
The print line didn’t show any agent.
Subject: RE: db library agent
give me your email, i will send you my example.
but look on my comments
Dim s As New NotesSession
Dim db As NotesDatabase
Dim nc As NotesNoteCollection
Set db = s.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = True
Call nc.BuildCollection // on this line nc should have the number of all agnet in database
Dim note As NotesDocument
Dim nid As String
Dim flag As String
nid = nc.GetFirstNoteId // nid ~ 15F (something like this)
For i = 1 To nc.Count
Set note = db.GetDocumentByID(nid) // note should be not empty…
flag = note.GetItemValue(“$Flags”)(0) // flag ~ “Se”
If Instr(flag, “S”) Then // “S” means that agnet is schedule
Print note.GetItemValue(“$Title”)(0)
End If
nid = nc.GetNextNoteId(nid) // we take next agent
Next
ok. give me your email. because a lot of spam here ))
Subject: RE: db library agent
my email address is alpa.patel@eisai.com