Тема: Отправка уведомлений в BIMOID с LotusScript.
Вызываем в кнопке отправки документа функцию
Call BIMOID (curdoc, picklist, strukdb, user , db )
Создаем функцию BIMOID в какой-либо библиотеке, и передаем в неё параметры - для отправки уведомлений в мессенджер BIMOID через серверный агент BIMOID.
Sub BIMOID (curdoc As NotesDocument, picklist As Variant, strukdb As NotesDatabase, user As String, db As NotesDatabase )
On Error GoTo Errh ' для отправк уведомлений в месседжер BIMOID серез серверный агент
Dim item As NotesItem
Dim strukview As NotesView
Set strukview = strukdb.GetView("notespeople")
Dim paramid As String
Dim agent As NotesAgent
Dim docRequest As NotesDocument
Dim docstrukt As NotesDocument
Dim BIMOID As Variant
BIMOID =""
str1=""
ForAll v In picklist 'Найти в БД Структура и взять chatid
Set docstrukt = strukview.GetDocumentByKey(v)
BIMOID = BIMOID + docstrukt.chatid(0) + Chr(10)
End ForAll
Print "BIMOID " BIMOID
mes= "Вам пришел документ " + CStr(curdoc.datereg(0)) + " №" + CStr(curdoc.fullregnom(0)) +Chr(10) + " от " + user
Set docRequest = db.CreateDocument
Set item = docRequest.AppendItemValue("doc_mes", mes)
Set item = docRequest.AppendItemValue("FIO", BIMOID)
Call docRequest.save(True, False)
Print "stsrt agent BIMOID"
Set agent = db.GetAgent("BIMOID")
paramid = docRequest.Noteid
Print "paramid=" + paramid
If Not agent.RunOnServer(paramid) = 0 Then
Print "не могу запустить агент"
End If
Print "end agent BIMOID"
Exit Sub
Errh:
Print "Ошибка BIMOID: " & Error(Err) & " в строке " & Erl
Exit Sub
End Sub