Sub Onload(Source As Notesuidocument)
On Error Goto Errh
Dim cDoc As NotesDocument
Set cDoc = Source.Document
If cDoc Is Nothing Then Exit Sub
Dim session As New NotesSession
Static db As NotesDatabase
Static view As NotesView
If db Is Nothing Then Set db = session.CurrentDatabase
If view Is Nothing Then Set view = db.GetView ("TypeOper\BP" )
Dim i As Integer
Dim itemNumberInSeries As NotesItem
Set itemNumberInSeries = cDoc.GetFirstItem( "NumberOfOper" )
Dim OtherDoc As NotesDocument
Dim OtherDocs As NotesDocumentCollection
Set OtherDocs = view.GetAllDocumentsByKey(cDoc.GetItemValue("BusinessProcess")(0), True)
Set OtherDoc = OtherDocs.getFirstDocument
If OtherDoc Is Nothing Then
Call itemNumberInSeries.AppendToTextList("1")
Exit Sub
End If
While Not OtherDoc Is Nothing
i = i + 1
Call itemNumberInSeries.AppendToTextList(Cstr( i ))
Set OtherDoc = OtherDocs.getNextDocument(OtherDoc)
Wend
Exit Sub
errh:
Msgbox Error & | in line | & Erl(), 64, |Lotus Notes (| & Lsi_info(2) & |)|
Exit Sub
End Sub