Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Joe am 23.01.03 - 15:31:15

Titel: Werte setzen in NotesCollection
Beitrag von: Joe am 23.01.03 - 15:31:15
Ich habe mal wieder ein Problem, über dem ich schon länger vergeblich brüte. Habe ein Script geschrieben, das eine Auswahl an Dokumenten als exportiert kennzeichnet und die Anzahlder Exporte festhalten soll. Die Markierung als exportiert klappt wunderbat, nur wird das Feld exportiert_Anzahl immer mit " 1" gefüllt. Woran kann das liegen bzw. wie funzt es richtig?  ???


Sub Indikator
     Dim workspace As New NotesUIWorkspace
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim collection As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim exportiert As String
     Dim exportiert_Anzahl As String
     
     Set db = session.CurrentDatabase
     Set collection = db.UnprocessedDocuments
     
     If (collection.Count > 0) Then
          Set doc = collection.GetFirstDocument
          While Not (doc Is Nothing)
               doc.exportiert = "1"
               doc.exportiert_Anzahl = Str(Val(exportiert_Anzahl)+1)
               Call doc.Save( True, True )
               Set doc = collection.GetNextDocument(doc)              
          Wend
          Call collection.UpdateAll          
          Call workspace.viewRefresh
     Else
     Msgbox "Nix gefunden..."
     End If
End Sub
Titel: Re:Werte setzen in NotesCollection
Beitrag von: Axel am 23.01.03 - 15:54:47
Hi,

du greifst nicht auf das Feld zu. Ändere dein Script wie folgt:
 
...
If (collection.Count > 0) Then
          Set doc = collection.GetFirstDocument
          While Not (doc Is Nothing)
              doc.exportiert = "1"
              doc.exportiert_Anzahl = Str(Val(doc.exportiert_Anzahl(0))+1)
              Call doc.Save( True, True )
              Set doc = collection.GetNextDocument(doc)              
          Wend
...      

Axel
   
Titel: Re:Werte setzen in NotesCollection
Beitrag von: Joe am 23.01.03 - 16:07:55
Super, danke. Manchmal hat man einfach ein Brett vor dem Kopf! Klappt prima!  :D