Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: kuschli am 25.01.05 - 13:33:48
-
Hallo!
Ich möchte über eine Schaltfläche im Hauptdokument eine Aktualisierung der dazugehörigen Antwortdokumentn anstossen.
Ich habe in meinem Hauptdokument Daten, die Teilweise bei Anlage eines Antwortdokumentes übernommen werden.
Wenn sich nun eine dieser Angaben ändert, soll die Änderung natürlich auch in die Antwortdokument hinein.
Dazu habe ich folgenden Script:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim collection As NotesDocumentCollection
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set collection = doc.Responses
varName = uidoc.FieldGetText("txtName")
While Not collection Is Nothing
UND HIER ???
Wend
End Sub
In der Schleife hakt es bei mir. Wie sage ich den Dokumenten, daß nun varName in das Feld txtName der Antwortdokumente aktualisiert werden soll?
Ich finde nichts dazu.
FieldSetText geht doch nur bei UiDocument, oder?
Version 5.0.10
Danke für Hilfe,
Kuschli
-
Hi,
so müsste das funktionieren:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim responsedoc As NotesDocument
Dim collection As NotesDocumentCollection
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set collection = doc.Responses
Set responsedoc = collection.GetFirstDocument
While Not (responsedoc Is Nothing)
responsedoc.txtName = doc.txtName
Set responsedoc = collection.GetNextDocument(responsedoc)
Wend
End Sub
Axel
-
Set docReponse = collection.GetFirstDocument
While Not (docResponse is Nothing)
docReponse.Feld = doc.Feld
call docResponse.Save (True, False, True)
Set docResponse = collection.GetNextDocument (docResponse)
Wend
HTH,
Bernhard
PS: Axel war schneller, aber: Speichern muss man das ResponseDoc noch
-
Upps, wozu speichern? ;D
Sorry, da hab ich doch glatt was vergessen. So kommts, wenn man an x Sachen gleichzeitig macht.
Axel
-
DANKE!
Ihr seid meine Helden!
Ich wusste echt nicht, wie ich es machen sollte. Mir fehlt noch soviel wissen in der Script-Programmierung das ich manchmal schreien könnte, weil ich wie mit einem Brett vorm Kopf vorm PC sitze.
Hat vielleicht jemand geheime Tips wie´s schneller besser wird???
Viele Grüße,
kuschli
-
Nur als Ergänzung :
Man könnte die Antwortdokumente in der Collection auch einfach per StampAll aktualisieren.
Call notesDocumentCollection.StampAll( itemname , value )
Spart die While-Schleife.
-
Du hast vollkommen Recht, Ingo. Ich hatte aber hier mehr an den Lerneffekt gedacht. StampAll kann ja jeder ;D
Bernhard
PS: Es ist aber wirklich so - an StampAll denkt man meist nicht ...
-
Sorry, da hab ich doch wieder alles versaut. Schande über mein Haupt ;D
-
Überhaupt nicht, Ingo, ganz im Gegenteil: Didaktisch-methodisch war Dein Vorgehen absolut perfekt ;)
Bernhard