Domino 9 und frühere Versionen > Entwicklung

[Dringend] Problem mit NotesDocumentCollection

(1/1)

Darkface:
Hallo zusammen,
wie kann ich in einer NotesDocumentCollection nur die Documente der Maske "X" einlesen.
Diese Abfrage brauche ich in einem Agenten der im hintergrund läuft.

Ich danke schonmal für jede Hilfe.

Gruß
Darkface

Rob Green:
"wie kann ich in einer NotesDocumentCollection nur die Documente der Maske "X" einlesen. "

um das vorher bereits abzufangen und nicht erst nachträglich Docs zu eine Collection hinzufügen zu müssen:

This script reminds project participants of their due date by mailing them a Project document from a database. The ReminderDate item on each document is used to indicate when a reminder should be sent. The Search method gets all Project documents whose ReminderDate item is set to today, mails the document, and updates the ReminderDate field to one week later.
Sub Initialize
 Dim db As New NotesDatabase("","reminder.nsf")
 Dim collection As NotesDocumentCollection
 Dim doc As NotesDocument
 Dim dateTime As New NotesDateTime("12/01/94")
 Dim nextDateTime As NotesDateTime    
 searchFormula$ = "Form = ""Project"" _
               & ReminderDate = @Today"
 Set collection = db.Search(searchFormula$,dateTime,0)


Und wenn Du - was Du leider nicht näher erläutert hast - bereits alle Docs aus einer View ausgelesen hast, dann halt über ne

fixiertes Doc
....
form=doc.form(0)
IF form="ABC" Then
mach diese
Else
mach jenes
...
nächstes Doc

eknori (retired):
Mal so aus dem Kopf:

Dim s as New NotesSession
Dim db as NotesDatabase
Set db = s.CurrentDatabase
Dim dateTime As New NotesDateTime( "01/01/70" )
Dim selection As String
Dim collection As NotesDocumentCollection
selection = "@Contains( FORM; ""X"" )"
Set collection = db.Search( selection, dateTime, 0 )

eknori

uups, da war jemand schneller

Zimmi:
Hallo,

das Ganze lässt sich auch über eine versteckte View mit der entsprechenden Viewselection realisieren und läuft auch recht schnell, da hier nicht die Collection erst zusammengebaut werden - außer du versuchst verschiedene Masken per Agent abzufragen, da kann das natürlich ein wenig umfangreich werden ...

Grüße von Zimmi

Darkface:
Super danke es hat funktioniert.

Danke an alle.

Gruß
 Darkface

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln