сорри, может туплю, но основной так и не закрыл..
начну сначала:
из основного документа через Action создается псевдодочерний док1.:
Sub Click(Source As Button)
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim uidoccom As NotesUIDocument
Dim w As New NotesUIWorkspace
Dim db As NotesDatabase
Dim ses As NotesSession
Dim docid As String
Dim number As String
' идентификатор родительского документа
Set uidoc = w.CurrentDocument
Set doc = uidoc.Document
docid = doc.GetItemValue("docid")(0)
number = doc.GetItemValue("number")(0)
Set uidoccom = w.ComposeDocument( "", "", "nc" )
Call uidoccom.FieldAppendText("docid_p", docid)
Call uidoccom.FieldAppendText("number_p", number)
End Sub
далее вновь в созданном документе, через Экшен сохраняем док2: @If(@IsValid;
@Do(@Command([FileSave]); @Command([FileCloseWindow])); "")
в событиях формы2:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim pdoc As NotesDocument
Dim uidoc As NotesUIDocument
Dim uipdoc As NotesUIDocument
Dim w As New NotesUIWorkspace
Dim pview As NotesView
Dim key As String
Set db=ses.CurrentDatabase
Set uidoc = w.CurrentDocument
Set doc = uidoc.Document
' ищем родительский документ заявку
Set pview = db.GetView("sortdocid")
Print "найдено представление: " & pview.Name
key = doc.GetItemValue("docid_p")(0)
Set pdoc = pview.GetDocumentByKey(key)
If pdoc Is Nothing Then
Print "Документ заявка не найден! "
Exit Sub
End If
Print "PDOC : " & pdoc.GetItemValue("Number")(0)
Call pdoc.ReplaceItemValue("WF_CurrentUser", "[Manager]")
Call pdoc.ReplaceItemValue("Serv_Man", "[Manager]")
Call pdoc.Save( True, True)
'Set uipdoc = w.EditDocument(True, pdoc)
'Call uipdoc.Save
'Call uipdoc.Close
Call uidoc.Close
'Call w.ReloadWindow
End Sub
Sub Postsave(Source As Notesuidocument)
Call Source.Close
End Sub
но первоначальный док1 я так и не смог закрыть вместе со вторым или что-то я не понял

h34r:
еще момент: хочу акшен скрывать потекущему занчению поля в доке типа Names.
сделать видимой кнопку только для пользователя имя которого на данный момент прописано в этом поле..
в случае ролей все понятно:
@If(!@IsMember("[Admin]"; @UserRoles); @True ;!@IsMember("[Supervisor]"; @UserRoles); @True; @False)
а с полем должно быть что-то типо такого:
!@IsMember(@UserName; FieldName)