Domino 9 und frühere Versionen > ND8: Entwicklung
Historie anlegen
Peter Klett:
--- Zitat von: ThomasHB am 10.02.11 - 11:21:23 ---Tja, dann verbuche ich wohl diese Aktion einfach mal unter Learning LotusScript. :P
--- Ende Zitat ---
Sehr gute Einstellung, weiter so ! ;)
ThomasHB:
--- Zitat ---Das ist ein Irrtum, GetNextDocument (doc) stoppt nicht, wenn sich die ID ändert, bleibt also nicht innerhalb der Kategorie (wäre mir jedenfalls völlig neu).
--- Ende Zitat ---
Doch, so wie ich das verstanden habe... Wenn Du nach GetDocumentByKey die Dokumente suchst und dabei aber eine Kategorisierte View hast, dann tritt genau dieser Effekt ein.
Die Designerhelp 8.5.2 für die GetDocumentbyKey Methode sagt unter Punkt 5 für mich genau das aus... Aber vielleicht habe ich das auch nicht richtig verstanden... Wenn das so ist, dann korrigiert mich gerne, damit ich hier nichts falsches im Gedächtnis halte... :)
Grüße,
Thomas
Peter Klett:
In der 7er Hilfe steht davon nichts. Falls das eine Änderung in 8 oder 8.5 ist, kann das eine böse Falle für ältere Scripte sein. Gut zu wissen ...
Nachtrag: Auszug aus Hilfe 7 zu diesem Thema (in GetDocumentByKey):
"If you use a GetNextDocument loop, you must explicitly check to make sure the next document is a match"
ThomasHB:
Lies es dir gerne mal durch... Ich habe es so verstanden. :)
Und dann eben für meine Zwecke so gebaut, wie ich dachte, das es sein muss...
Das es auch elegant geht, habe ich erst heute erfahren... ;)
--- Zitat von: IBM Lotus Designer 8.5.2 ---This script gets all of the documents in the category "Spanish leather" in the By Category view of the current database, and puts them in the Boots folder. The script finds the first document in the category using GetDocumentByKey, and the remaining documents in the category using GetNextDocument. The script uses the ColumnValues property in NotesDocument to check each document's column values: as long as a document's value for the first sorted column in the view equals "Spanish leather," the script places the document in the Boots folder. If the document's value for the first sorted column does not equal "Spanish leather," or if there are no more documents in the view, the script ends.
See GetAllDocumentsByKey for an easier way to do this. The only advantage to this technique is that it correctly sets the ColumnValues property in the retrieved documents while GetAllDocumentsByKey does not.
--- Ende Zitat ---
--- Code: ---Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim column As NotesViewColumn
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( "By Category" )
' get the first sorted and categorized column in the view
Forall c In view.Columns
If ( c.IsSorted And c.IsCategory ) Then
Set column = c
Exit Forall
End If
End Forall
' get the first document that matches the key
Set doc = view.GetDocumentByKey( "Spanish leather" )
' get the remaining documents that match the key
' since ColumnValues array starts at 0 for position 1,
' subtract 1 from the column position
Do While Not ( doc Is Nothing )
If ( doc.ColumnValues( column.Position - 1 ) = _
"Spanish leather" ) Then
Call doc.PutInFolder( "Boots" )
Else
Exit Do
End If
Set doc = view.GetNextDocument( doc )
Loop
--- Ende Code ---
klaussal:
Aus der 8er-Hilfe:
--- Zitat ---This script gets all of the documents in the category "Spanish leather" in the By Category view of the current database, and puts them in the Boots folder. The script finds the first document in the category using GetDocumentByKey, and the remaining documents in the category using GetNextDocument. The script uses the ColumnValues property in NotesDocument to check each document's column values: as long as a document's value for the first sorted column in the view equals "Spanish leather," the script places the document in the Boots folder. If the document's value for the first sorted column does not equal "Spanish leather," or if there are no more documents in the view, the script ends.
See GetAllDocumentsByKey for an easier way to do this. The only advantage to this technique is that it correctly sets the ColumnValues property in the retrieved documents while GetAllDocumentsByKey does not.
--- Ende Zitat ---
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln