Domino 9 und frühere Versionen > Entwicklung

Felder in Antwortdokumenten aktualisieren

(1/2) > >>

kuschli:
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

Axel:
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

koehlerbv:
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

Axel:
Upps, wozu speichern? ;D

Sorry, da hab ich doch glatt was vergessen. So kommts, wenn man an x Sachen gleichzeitig macht.



Axel


kuschli:
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

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln