Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: OCS am 15.05.06 - 17:53:42

Titel: Wiedervorlage
Beitrag von: OCS am 15.05.06 - 17:53:42
Hallo zusammen,
hab mir einen kleinen Agenten geschrieben, der mir aus Dokumenten die ein Datumsfeld mit dem Tagesdatum enthalten eine kleine Erinnerung schicken soll...

Das Problem: Ich flieg beim Setzen der Collection raus (Type mismatch)...

Code:

Sub Initialize
   Dim i As Integer
   Dim datetime As New NotesDateTime( "" )   
   'Zu Prüfende Schlüssel
   Dim now_time As String
   Dim session As notessession
   Dim db As NotesDatabase
   Dim workspace As notesuiworkspace
   Dim acol As NotesDocumentCollection
   Dim doc As NotesDocument
   Dim test As String
   
   Dim akey As String
   Set db = New notesDatabase ("OCS02/OCS GmbH","aktiv\fb013.nsf")
   Set aview = db.getview ("vorlage")   
   
   dateTime.LSLocalTime = Now      
   Call dateTime.SetNow     
   now_Time = dateTime.LocalTime
   
   now_time=Left(now_time,10)
   Print now_time
   akey = "FB013"
   
   Set acol = aView.GetAllDocumentsbyKey(now_time,exact)
   
   Print acol.count
   
%REM For i = 1 To acol.count
      
      Set adoc  = acol.GetFirstDocument
      
      
      Set docmail = New NotesDocument( db )
REM   Call docsupport.Save( True, True )
      SupportText = docSupport.GetItemValue( "DocText" )
      docmail.SendTo = docsupport.DocKundeMail
      docmail.Subject = "Erinnerung: Supportdokument adoc.DocLfdNr(0)"
      docmail.Body    =   adoc.TextWiedervorlage(0)
      
   Next
%ENDREM

End Sub



Meine View ist nach dem Wiedervorlagedatum sortiert!

Würd mich über hilfe freuen!  O0

Gruß Björn

Titel: Re: Wiedervorlage
Beitrag von: Onkel Domino am 15.05.06 - 21:34:56
Die Zeile

Set acol = aView.GetAllDocumentsbyKey(now_time,exact)

ist falsch. Als Option muss ein Boolean übergeben werden, also:

Set acol = aView.GetAllDocumentsbyKey( now_time , true )

Außerdem würde sich die Variable "aview" über eine Deklaration freuen  ;D
Titel: Re: Wiedervorlage
Beitrag von: OCS am 15.05.06 - 22:23:55
dank dir! die view hab ich unter declerations!  ;)

gruß