Hallo zusammen,
ich habe ein offenes Dokument mit einer eingebetteten Ansicht. Dort werden mit ShowSingleCategory Kinddokumente angezeigt (1.Spalte kategorisiert mit $REF)
In der zweiten Spalte ist ein Feld "Anzahl". Dieses Feld soll in der eingebettetn Ansicht mit InViewEdit verändert werden können.
Das ganze funktioniert auch, wenn ich die Ansicht direkt öffne, oder das ShowSingleCategory herausnehme.
Sobald aber ShowSingleCategory eingestellt ist, stürzt mir der NotesClient sofort ab. (sh. Fehler.jpg)
Hier mein InViewEditCode (Im Grunde aus der DesignerHilfe herauskopiert und 2-3 kleinere Sachen angepasst)
Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)
%REM
This view has two editable columns: one Text and one Numeric.
The programmatic name of each editable column
is the same as the name of the field whose value it holds,
but the processing for each column is different.
%END REM
REM Define constants for request types
Const QUERY_REQUEST = 1
Const VALIDATE_REQUEST = 2
Const SAVE_REQUEST = 3
Const NEWENTRY_REQUEST = 4
REM Define variables
Dim ws As New NotesUIWorkspace
Dim uid As NotesUIDocument
Set uid=ws.CurrentDocument
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim caret As String
REM Get the CaretNoteID - exit if it does not point at a document
caret = Source.CaretNoteID
If caret = "0" Then Exit Sub
REM Get the current database and document
Set db = Source.View.Parent
Set doc = db.GetDocumentByID(caret)
REM Select the request type
Select Case Requesttype
Case QUERY_REQUEST
REM Reserved - do not use for Release 6.0
Case VALIDATE_REQUEST
REM Write message and cause validation error if ...
Select Case Colprogname(0)
Case "Anzahl"
REM ... value in numeric column is non-numeric or negative
If Isnumeric(Columnvalue(0)) Then
If Cint(Columnvalue(0)) < 0 Then
Messagebox "Value must be greater than 0",, "Negative value"
Continue = False
End If
Else
Messagebox "Value must be numeric",, "Non-numeric value"
Continue = False
End If
Case "Preis"
REM ... value in numeric column is non-numeric or negative
If Isnumeric(Columnvalue(0)) Then
Else
Messagebox "Value must be numeric",, "Non-numeric value"
Continue = False
End If
End Select
Case SAVE_REQUEST
REM Write the edited column view entries back to the document
For i = 0 To Ubound(Colprogname) Step 1
Select Case Colprogname(i)
REM Write text entry back to docume
REM Write converted numeric entry back to document
Case "Anzahl"
Call doc.ReplaceItemValue(Colprogname(i), Cint(Columnvalue(i)))
Call doc.ComputeWithForm(True,True)
Case "Preis"
Call doc.ReplaceItemValue(Colprogname(i), Cint(Columnvalue(i)))
Call doc.ComputeWithForm(True,True)
End Select
Next
REM Save(force, createResponse, markRead)
Call doc.Save(True, True, True)
Case NEWENTRY_REQUEST
REM Create document and create "Form" item
REM Write column values to the new document
Set doc = New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main")
For i = 0 To Ubound(Colprogname) Step 1
Select Case Colprogname(i)
REM Write text entry to document
Case "FieldText"
Call doc.ReplaceItemValue(Colprogname(i), Columnvalue(i))
REM Write converted numeric entry to document
Case "Anzahl"
Call doc.ReplaceItemValue(Colprogname(i), Cint(Columnvalue(i)))
End Select
Next
REM Save(force, createResponse, markRead)
Call doc.Save(True, True, True)
End Select
If Not uid Is Nothing Then
Call uid.Refresh
End If
End Sub