Ah
,
hier der Code aus dem Button zum erstellen:
Dim w As New NotesUiWorkspace
Dim session As New NotesSession
Dim DB As NotesDatabase
Set Db = session.currentdatabase
Dim doc As NotesDocument
Dim aDoc As New NotesDocument(DB)
Dim uidoc As NotesUiDocument
Set doc = session.DocumentContext
If doc.Form(0) = "frmKunden" Then
DocID = doc.fdokid(0)
aDoc.Form = "frmAnsprechpartner"
If aDoc.fdokid(0) = "" Then aDoc.fdokid = DocID
aDoc.Save True, True
Call w.SetTargetFrame("fraBody")
Set uidoc = w.EditDocument( True, aDoc)
Else
Msgbox "Bitte wählen Sie einen Kunden aus!"
End If
Und hier der Code zum Speichern:
Dim w As New NotesUiWorkspace
Dim s As New NotesSession
Dim Doc As NotesDocument
Dim Doc2 As NotesDocument
Dim uidoc As NotesUiDocument
Dim view As NotesView
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Set view = db.GetView("vwKunden")
Set uidoc = w.currentDocument
docid = uidoc.fieldGettext("fdokid")
Set doc = view.GetDocumentbyKey(docid,True)
If doc Is Nothing Then
Msgbox "Es wurde kein Haupt-Doc gefunden"
Else
Set doc2 = uidoc.document
Call doc2.MakeResponse( doc )
Call doc2.save (True, True)
Call uidoc.FieldSettext("SaveOption","0")
Hier müsste man dann noch das dok schließen
End If