Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: robertpp am 14.02.03 - 09:09:03

Titel: Anwortdokument erstellen
Beitrag von: robertpp am 14.02.03 - 09:09:03
Ich hab dazu diesen eintrag gefunden:
http://www.atnotes.de/index.php?board=7;action=display;threadid=2465

Ich kann auch ein Anwortdoc erstellen per @Formel !
Aber wie kann ich ein anwortdocument automatisch bei speichern des parentdocs erzwingen?
Habs mal so probiert:

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim uiws As New NotesUIWorkspace   
   Dim doc As NotesDocument
   Dim uidoc As NotesUIDocument   
   Set db = session.CurrentDatabase
   Set doc = New NotesDocument(db)
   Set uidoc= uiws.currentDocument
   doc.Form = "his"
   doc.SaveHistory = uidoc.FieldGetText("SaveHistory")   
   Call doc.Save(True, False)
End Sub

Aber wie sag ich dem doc jetzt das es ein anwortdoc von dem aktuellen doc ist?

robertpp
Titel: Re:Anwortdokument erstellen
Beitrag von: robertpp am 14.02.03 - 09:12:13
Ich glaub ich war zu voreilig!!!

ich probies mal mit
Call docB.MakeResponse( docA )
docB.Form = "Response"

robertpp
Titel: Re:Anwortdokument erstellen
Beitrag von: robertpp am 14.02.03 - 09:15:58
Wie kann ich aber jetzt statt

Call docB.MakeResponse( docA )
docB.Form = "Response"

docA das currentDocument auswählen?

Oder ist es vielleicht möglich im anwortdoc das $REF feld zu erstellen und in dieses feld dan die DOCUNIDID hineinschreibe vom hauptdic?
robertpp
Titel: Re:Anwortdokument erstellen
Beitrag von: Rob Green am 14.02.03 - 10:43:21

Zitat
Oder ist es vielleicht möglich im anwortdoc das $REF feld zu erstellen und in dieses feld dan die DOCUNIDID hineinschreibe vom hauptdic

Nur zum Verständnis: das $REF Feld enthält bereits die DOCUNIDID des Parents vollautomatisch, wenn das Response auf Basis des Parents erstellt wird.

Leider kann ich den eigentlichen Part Deiner Frage nicht verstehen, weil ich nicht geschnackelt habe, wo genau nun Deine zu knackende Nuss liegt?
Titel: Re:Anwortdokument erstellen
Beitrag von: robertpp am 14.02.03 - 11:25:56
Mein Problem besteht darin das ich einfach ein doc erstellen per script:

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim uiws As New NotesUIWorkspace  
  Dim doc As NotesDocument
  Dim uidoc As NotesUIDocument  
  Set db = session.CurrentDatabase
  Set doc = New NotesDocument(db)
  Set uidoc= uiws.currentDocument
  doc.Form = "his"
  doc.SaveHistory = uidoc.FieldGetText("SaveHistory")  
  Call doc.Save(True, False)
End Sub

nur soll dieses doc ein Antwortdocument von uidoc sein wo ich mich gerade befinde! (currentdocument)



Die unschöne variante es zu lösen ist:

@Command([FileSave]);                 Hauptdoc speichern
@Command([Compose];"his");       Antwortdoc erstellen
@Command([FileSave]);                   Antwortdoc speichern
@Command([FileCloseWindow]);      
@Command([FileCloseWindow])              beide doc schließen

Dann sehe ich in meiner ansicht das antwortdoc kategorisiert zum hauptdoc.
bei der oben variante(lscript) weiß er aber nicht das er ein parentdoc hat und schreibt es einfach in die ansicht unten hinein!
Titel: Re:Anwortdokument erstellen
Beitrag von: ata am 14.02.03 - 11:28:26
... schau dir mal das NotesDocument-Object in der Hilf an, da gibt es eine Methode ein Dokument zum Antwort-Dokument eines anderen zu machen...

ata
Titel: Re:Anwortdokument erstellen
Beitrag von: forrest g am 14.02.03 - 11:36:06
hi,

füg das malinden codeein:

set hauptdoc = uidoc.document
Call doc.MakeResponse( hauptdoc )
Call doc.Save(True, False)

Titel: Re:Anwortdokument erstellen
Beitrag von: robertpp am 14.02.03 - 11:48:33
genau die zwei zeilen haben mir gefehlt!
danke forrest g

Endergebnis:
Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim uiws As New NotesUIWorkspace   
   Dim doc As NotesDocument
   Dim docH As NotesDocument
   Dim uidoc As NotesUIDocument   
   Set db = session.CurrentDatabase
   Set doc = New NotesDocument(db)
   Set uidoc= uiws.currentDocument
   Set docH = uidoc.document
   Call doc.MakeResponse( docH )
   doc.Form = "his"
   doc.SaveHistory = uidoc.FieldGetText("SaveHistory")   
   Call doc.Save(True, False)
   
End Sub


robertpp
Titel: Re:Anwortdokument erstellen
Beitrag von: forrest g am 14.02.03 - 12:51:09
...klar...gerne...