Sub Initialize
' Функция выполняет обновление всех зависимых документов...
' Обновление происходит по виду "RequestAdd~RequestUNID"
Dim session As New NotesSession
Dim db As NotesDatabase
Dim agent As NotesAgent
Dim view As NotesView
Dim collection As NotesDocumentCollection
Dim wdoc As NotesDocument
Dim doc As NotesDocument
Dim item As NotesItem
Dim count As Integer
Set agent = session.CurrentAgent
Set db = session.CurrentDatabase
Set doc = db.GetDocumentByID(agent.ParameterDocID)
Set view = db.GetView("RequestAdd~RequestUNID")
Call view.Refresh
Set collection = view.GetAllDocumentsByKey(Cstr(doc.UniversalID), True)
If collection.Count = 0 Then Exit Sub
count% = 0
Set wdoc = collection.GetFirstDocument
While count <= collection.Count
' Обновим поля в приложениях...
count%=count%+1
Call wdoc.ReplaceItemValue("Visible",doc.Visible(0))
Call wdoc.Save(True, True)
Set wdoc = collection.GetNextDocument(wdoc)
Wend
Delete session
End Sub