Allt om Lotus Notes & Domino

Daily email event report from DDM 2
I have improved the script that send me daily reports from DDM. This version will now color code each severity in the email and it now also use the "recent events" view instead of the "open events"
Put the script below in a daily scheduled agent and you will recieve an nicely color coded email containing todays events

If you setup a server collection hierarchy in events4.nsf your should run the script on the collecting server to get events from all servers in your email.

Image show what the daily email looks like

' Loop all open and recent ddm events and email them
' Put this script in a scheduled agent and run it daily

On Error GoTo e
Dim session As New NotesSession,db As NotesDatabase
Dim view As NotesView,maxdays As Integer, style As NotesRichTextStyle
Dim maildoc As NotesDocument, rt As NotesRichTextItem, c As Integer
Dim entry As NotesViewEntry, nav As NotesViewNavigator
Dim server As String, emails As Variant,sev As Variant

emails = Evaluate(|"":""|)
maxdays = 1
server = "domino1"
Dim dt As New NotesDateTime("Today")

Set db = session.GetDatabase(server,"ddm.nsf")
Set view = db.getView("vwEventsByDate2")
Set nav = view.CreateViewNav
Set style = session.CreateRichTextStyle
style.FontSize = 8
style.NotesFont = FONT_HELV

Set maildoc = db.Createdocument()
maildoc.Form = "Memo"
maildoc.Subject = "Domino events for " + dt.Dateonly
Set rt = maildoc.Createrichtextitem("Body")
c = 0

Call rt.AppendStyle(style)
Call rt.Appendtext("Open DDM -> ")
Call rt.Appenddoclink(db,"Link to DDM")
Call rt.Addnewline(1)
Call rt.Appendtext("Domino events for " + dt.Dateonly)
Call rt.Addnewline(1)

Set nav = view.CreateViewNav
Set entry = nav.GetFirst
Do Until entry Is Nothing
If entry.IsDocument Then

sev = entry.Columnvalues(7)
Select Case sev
Case ".high":
style.Notescolor = COLOR_RED
Call rt.AppendStyle(style)
Case ".failure":
style.Notescolor = COLOR_RED
Call rt.AppendStyle(style)
Case ".low":
style.Notescolor = COLOR_DARK_RED
Call rt.AppendStyle(style)
Case ".normal":
style.Notescolor = COLOR_BLACK
Call rt.AppendStyle(style)
Case Else:
style.Notescolor = COLOR_BLACK
Call rt.AppendStyle(style)
End Select
Call rt.Appenddoclink(entry.document,"Link to ddm.nsf")
Call rt.Appendtext(CStr(entry.Columnvalues(4)))
Call rt.Appendtext(CStr(entry.Columnvalues(5)))
Call rt.Appendtext(CStr(entry.Columnvalues(8)))
Call rt.Addnewline(1)
Call rt.Addnewline(2)
If entry.Indentlevel = 0 Then
Call rt.Appendtext(entry.Columnvalues(2))
If c=> maxdays Then Exit do
Call rt.Appendtext(entry.Columnvalues(3))
c = c + 1
End If
Call rt.Addnewline(2)

End If
Set entry = nav.GetNext(entry)

Call maildoc.send(False,emails)
Exit Sub
Print Error,erl

Relevanta Poster på Notessidan:

Fler Poster om:

Fler bloggar om:


Publicerad 2014-06-12 | Kommentarer: 2 | Läsningar:


Palmi ( 2014-06-12 14:07:31 )

Stephy Wilson ( 2014-12-18 08:00:38 )

Sök på Notessidan
Thomas Adrian
ThomasCertifierad utvecklare och administratör inom Notes & Domino

Kontakta mig

Senaste Sökningarna på Notessidan
Sön - sharepoint (R:1)
Sön - räkna and antal and besökare (R:0)
Sön - browser (R:17)
Sön - stoppar and mail (R:1)
Sön - korrupt (R:3)
Sön - böcker (R:0)
Sön - kalendern (R:12)
Sön - feature (R:15)
Sön - print and mime (R:2)
Sön - länka (R:0)
Sön - databasen (R:94)
Sön - access (R:47)
Sön - outlook (R:15)
Sön - webanvändare (R:0)
Sön - google and maps (R:6)
Sön - juffe (R:2)
Sön - uidoc.print (R:1)
Sön - java and lotusscript (R:26)
Sön - besök (R:0)

Databasstatistik Blogg
Uppdateras var 15:e Minut

Antal Poster:562
Antal Kommentarer: 1552
Alla sidvisningar idag:
Unika Besökare idag:
Databasstorlek: 112,25Mb
Fixup: 2020-10-01 00:30:25
FT:2020-10-01 11:51:23
DB Procent använd: 97,4
Antal Agenter: 42
Antal Formulär: 65
Antal Vyer: 60
Antal Dokument: 8350
Antal Image Resources: 108
Antal Subformulär: 18
Antal Scriptbibliotek: 11
Totalt Antal Designelement: 576
Antal Attachments: 158
Antal Konflikter: 0
Server version 1: 452
Server version 2: Release 11.0.1|March 21, 2020
Server Plattform: Windows/64
Ändrad: 2020-10-01 13:19:53
Server Tidszon: Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=133$ZN=W. Europe
Kommentarsspam Idag: 7
Kommentarsspam Totalt: 24793

Top Sites at

Fight Spam! Click Here!

Listed on BlogShares

Increase website traffic

Top Internet Blogs

Site Checker