Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: valheru am 12.06.03 - 11:02:29
-
Hallo,
ich habe das Problem, daß ich von einem Antwortdokument Felder im Ursprungsdokument ändern muß. Da dies bei mir über @SetField und @SetDocField nur funktioniert, wenn das Ursprungsdokument geschlossen ist (Warum eigentlich?), habe ich in das Antwortdokument folgendes eingefügt, um zu gewährleisten, daß dieses auch wirklich geschlossen ist, wenn das Antwortdokument bearbeitet wird:
Sub Postopen(Source As Notesuidocument)
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim qualitydoc As NotesDocument
Dim projectdoc As NotesDocument
Dim uiws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Dim uidoc As NotesUIDocument
Dim uidoc1 As NotesUIDocument
Dim item As NotesItem
Dim unid As String
Set uidoc = uiws.CurrentDocument
Set qualitydoc = uidoc.Document
Set uidb = uiws.CurrentDatabase
Set db = uidb.Database
unid = qualitydoc.ParentDocumentUNID
Set projectdoc = db.GetDocumentByUNID(unid)
Call uiws.EditDocument( "1", projectdoc)
Set uidoc1 = uiws.CurrentDocument
Call uidoc1.Save
Call uidoc1.Close
End Sub
Dies öffnet dann zwar das Ursprungsdokument, aber:
Für das Save bekomme ich eine Fehlermeldung (DocumentCommand not available ) und für das Close (wenn ich das Save weglasse) passiert gar nichts.
Habt Ihr dazu eine Idee?
Für Hinweise jeder Art schonmal vielen Dank, Valheru.
-
... wo ist der set für das uidoc1 .... ??? ???
-
...drittletzte Zeile ...
-
Hi,
versuch doch mal mit Scriptfunktionen die Felder zu ändern.
Axel
-
Call uiws.EditDocument( "1", projectdoc)
Set uidoc1 = uiws.CurrentDocument
Set uidoc1 = uiws.EditDocument("1" ; projectdoc)
... genügt bereits
... die Fehlermeldung erscheint eventuell, weill du im ParentDoc vielleicht nicht editieren darfst. Sie kommt auch, wenn du im Lesemodus bist und versucht per uidoc etwas zuzuweisen...
... speichern kann man nur, wenn das Dokument im Editmodus ist.
ata
-
Warum deklarierst Du eigentlich das UIDoc nochmals ? Source = UIDocument ?
Meff
-
Nur so zur Info: Ab R6 oder R6.5 (weiss ich leider nicht mehr so genau) kann man setdocfield auch im gleichen Dokument benutzen.
Aber das wird dir wahrscheinlich nicht weiterhelfen...
::)