Domino 9 und frühere Versionen > ND6: Entwicklung

Bekomme Fehler: "Error creating product object"

<< < (4/4)

dabjoern:
Danke Bernhard,
du hast völlig recht. Ich rufe nun ReOpen(doc) nach der Schleife auf und siehe da: ES GEHT!!! Nun klappt alles so, wie es sein soll.
Beste Grüße
Björn

Hier nochmals der FUNKTIONSFÄHIGE Code:

--- Code: ---Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument, ldoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim key As Variant
Dim counter As Integer
Dim linkName As String, feldName As String, fieldcounter(1 To 4) As String

Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument

Call uidoc.Save
Set doc = uidoc.Document

fieldcounter(1) = "EB_counter"
fieldcounter(2) = "UB_counter"
fieldcounter(3) = "TB_counter"
fieldcounter(4) = "Coach_counter"

For i = 1 To 4
counter = uidoc.FieldGetText(fieldcounter(i))
For j = 1 To counter
linkName = "SO_Link_" + Cstr(i) + "_" + Cstr(j)
feldName = "SO_Name_" + Cstr(i) + "_" + Cstr(j)

key = uidoc.FieldGetText(feldName)

Set rtitem = New NotesRichTextItem(doc,linkName)

Set view = db.GetView("Person" )
Set ldoc = view.GetDocumentByKey(key)
If (key <> "") Then
If ldoc Is Nothing Then
Messagebox("Could not find document for " & key & ".")
Exit Sub
Else
Call uidoc.FieldClear(linkName)
Call rtitem.AppendDocLink(ldoc, "Link")
End If
Else
Call uidoc.FieldClear(linkName)
End If
Set rtitem = Nothing

Next j
Next i
Call ReOpen(doc)
End Sub
--- Ende Code ---

An der Funktion ReOpen habe ich nichts geändert.

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln