Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Darkface am 23.09.02 - 11:37:23

Titel: [Dringend] Problem mit NotesDocumentCollection
Beitrag von: Darkface am 23.09.02 - 11:37:23
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
Titel: Re: [Dringend] Problem mit NotesDocumentCollection
Beitrag von: Rob Green am 23.09.02 - 11:51:00
"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
Titel: Re: [Dringend] Problem mit NotesDocumentCollection
Beitrag von: eknori am 23.09.02 - 11:52:50
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
Titel: Re: [Dringend] Problem mit NotesDocumentCollection
Beitrag von: Zimmi am 23.09.02 - 11:54:41
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
Titel: Re: [Dringend] Problem mit NotesDocumentCollection
Beitrag von: Darkface am 23.09.02 - 12:10:29
Super danke es hat funktioniert.

Danke an alle.

Gruß
 Darkface