Domino 9 und frühere Versionen > ND7: Entwicklung

NextSibling bricht ab

(1/3) > >>

botschi:
Aus der Hilfe habe ich folgenden Code (leicht abgewandelt):


--- Code: ---Dim parentDoc As NotesDocument
Dim responseDoc As NotesDocument

Set parentDoc = view.GetFirstDocument     
'   Visit each main document in the view
While Not ( parentDoc Is Nothing )

Set responseDoc = view.GetChild( parentDoc )
  '   Visit each of the parent's response documents
While Not ( responseDoc Is Nothing )
responseDoc.ExpireDate = Cdat(askme)
Call responseDoc.Save(True, False)
Set responseDoc = view.GetNextSibling( responseDoc )
Wend
  '   Put the new total onto the parent document
doc.ExpireDate = Cdat(askme)
Call parentDoc.Save( True, False )
Set parentDoc = view.GetNextSibling( parentDoc )
Wend
--- Ende Code ---
Bei
--- Code: ---Set parentDoc = view.GetNextSibling( parentDoc )
--- Ende Code ---
bricht der Agent mit "Eintrag im Index nicht gefunden" ab.
In der Hilfe steht dazu:

--- Zitat ---If the specified view is different from the current view, the GetNextSibling method returns the following error: "Document not found in <view>." That is, you can only navigate using the Document parameters that are from the same view in which you are navigating.
--- Ende Zitat ---

Ich hab doch nur 1 View, es gibt keine andere in diesem Agenten. Auch wenn ich die angegebene View as Default kennzeichne, bricht der Agent da ab.

Kann mir jemand helfen?

Matthias

ata:
Hallo Matthias,

... ich arbeite nicht mit Siblings, sondern mit Responses. Über Responses.Count hast du die Gewissheit, daß es keine gibt - ansonsten eben mit GetFirstDocument und GeNextDocument laufen...

Toni

botschi:
OK, dann bastel ich das mal um und probier.
Dennoch macht mich das nicht restlos glücklich, die Lösung fand ich eigentlich ziemlich gut...

Matthias

botschi:
Der Code bricht mit dem selben Fehler bei "view.getnextdocument(doc)" ab

--- Code: ---Set doc = view.GetFirstDocument
If Not doc Is Nothing Then

'%REM
Dim parentDoc As NotesDocument
Dim responsecoll As NotesDocumentcollection

Set parentDoc = view.GetFirstDocument     
'   Visit each main document in the view
While Not ( parentDoc Is Nothing )

Set responsecoll = parentDoc.Responses
If Not responsecoll.Count = 0 Then
Call responsecoll.StampAll("ExpireDate",Cdat(askme))
End If

doc.ExpireDate = Cdat(askme)
Call parentDoc.Save( True, False )
Set parentDoc = view.GetNextDocument(parentDoc)
Wend
--- Ende Code ---

Liegt es an meiner Ansicht? Die erste Spalte ist sortiert, keine Kategorie...

Matthias

m3:
"doc.ExpireDate = Cdat(askme)"
Sollte das nicht "parentdoc" sein?

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln