Domino 9 und frühere Versionen > Entwicklung
Agent
doliman:
Hi,
war etwas früh heute morgen.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view1 As NotesView
Dim view2 As NotesView
Dim doc1 As notesdocument
Dim doc2 As notesdocument
Dim keys( 1 To 2 ) As String
Set db = session.CurrentDatabase
Set view1 = db.GetView( "ThemaView" )
Set view2 = db.GetView( "(CounterView2)" )
Set doc1 = view1.getfirstdocument
Do While doc1 Is Nothing
iddoc1$ = doc1.uinversalid
keys( 1 ) = iddoc1$
Set doc2 = view2.GetDocumentByKey( keys )
If doc2 Is Nothing Then
Set doc2 = New NotesDocument(db)
doc2.Form = "Counter"
doc2.Unid_Faq = doc1.uinversalid
doc2.N_Views = 0
doc2.Save(true,true)
End If
Loop
End Sub
Beider View die 2 nicht vergessen
und das save für das Doc.
Die "(CounterView2)" Ansicht muß in der ersten spalte
das Feld "Unid_Faq" kategorisiert sein, da Du in dieses Feld die UNID des Doc1 schreibst .
HipSlu:
Hallo,
sorry, ich muß nochmal lästig sein....
bei
doc2.Save(true,true)
schreibt der designer:
"Initialize: 27: Illegal use of parantheses"
und ansonsten - wenn ich das "doc2.Save(true,true)" rausnehme - und den agent mit debug lotus script laufen lasse, dann springt er bei "Do While doc1 Is Nothing " sofort auf "End Loop"....
d.h. er findet anscheinend gar kein Dokument??
??? ??? ???
doliman:
Hi,
sorry das müsste heißen:
do while not doc1 is nothing
und
Call doc2.Save( true, True )
HipSlu:
hi,
jetz habe ich bei
"Do While doc1 Is Not Nothing "
"17: Type mismatch"
wenn ich das "do while..." und "loop" auskonvertiere, also nur das erste doc bearbeiten würde, so bekomm ich übrigens bei " iddoc1$ = doc1.uinversalid "
ebenfalls "Type mismatch"
doliman:
Hi,
TIPPFEHLER
doc1.UniversalID
und das "not" kommt vor das doc1.
Warst schneller als ich korrigiert habe
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln