Public Function ProcessPositions(Doc, detaildoc)As NotesDocument ......... End Function
Dim ResultDoc As NotesDocument ProcessPositions = ResultDoc
Public Function ProcessPositions(Doc, detaildoc)As NotesDocument Dim collection As NotesDocumentCollection Dim posDoc As NotesDocument Dim ResultDoc As NotesDocument Dim i As Integer If Doc.EditKst(0) = 1 Then Doc.EditKst = 0 Doc.BestellNr = GetNextBestellNr( Doc ) Call Doc.save( True, True ) End If Set collection = db.Search( |Form = "Bestellposition" & ParentUNID = "| + Doc.UniversalID + |"|, Nothing, 0 ) ' zur Sicherheit neu abspeichern Doc.LastDetailPos = collection.Count For i = 1 To collection.Count Set detailDoc = collection.GetNthDocument(i) ' Zur Sicherheit neu durchnummerieren detailDoc.Pos = i detailDoc.BestellNr = Doc.BestellNr detailDoc.HB = Doc.HB detailDoc.Kst = Doc.Kst detailDoc.Status = Doc.Status Call detailDoc.Save( True, True ) If detailDoc.SonderBestellung(0) = "1" Then ' Call pingSonderBesteller( posDoc ) End If Next Set ResultDoc= ProcessPositions(?,?) End Function