Hallo,
habe eine Ansicht in der ich die Spalten Editierbar gemacht habe, folgender Code im Modul Inviewedit:
Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)
On Error Goto errhandler
''code for modifying only the company column and not adding new documents from view.
Const QUERY_REQUEST = 1 ' used when the user enters the editable column
Const VALIDATE_REQUEST = 2 ' used when the user exits the editable column
Const SAVE_REQUEST = 3 ' saves after validation for an existing view entry
Const NEWENTRY_REQUEST = 4 ' after validation when the user makes a new entry in a view
' Editable columns
fieldName(0) = "work_plan_device_percent"
fieldName(1) = "work_plan_setup_time"
fieldName(2) = "device_piece"
fieldName(3) = "work_plan_time_piece"
fieldName(4) = "work_plan_follow_nr"
Dim ws As New NotesUIWorkspace
Dim note As NotesDocument
Dim db As NotesDatabase
Dim i As Integer
Set db = ws.CurrentDatabase.Database
If (Source.CaretNoteID = "0") Then Exit Sub
Set note = db.GetDocumentByID(Source.CaretNoteID) ' The Notes ID of the document currently highlighted (that is, at the caret location) in a view
If (note Is Nothing) Then Exit Sub
If (RequestType = QUERY_REQUEST) Then
Continue = True
Elseif (RequestType = VALIDATE_REQUEST) Then
For i = 0 To 4
If(note.HasItem(fieldName(i))) And ColProgname(0) = fieldName(i) Then
fieldValue(i) = ColumnValue(0)
If i = 0 Or i=1 Or i=2 Or i=3 Or i=4 Then
If Not Isnumeric(fieldValue(i)) Then
Msgbox "Bitte Zahl eingeben."
Continue = False
Exit Sub
End If
End If
End If
Next
Continue = True 'Accept any user input
Elseif (RequestType = SAVE_REQUEST) Then
For i = 0 To 4
If fieldValue(i) <> "" Then
If Isnumeric(fieldValue(i)) Then
Call note.ReplaceItemValue(fieldName(i), Cdbl(fieldValue(i)))
Else
Call note.ReplaceItemValue(fieldName(i), fieldValue(i))
End If
End If
Next
Call note.ComputeWithForm(True, True)
Call note.Save(True, True, True)
Elseif (RequestType = NEWENTRY_REQUEST) Then
Set note = New NotesDocument( db )
note.Form = "FormlessRequest"
note.Status = 2
Call note.ComputeWithForm( False, False )
Call note.Save(True, True, True)
End If
Exit Sub
errhandler:
Msgbox Error, 16, "Ansicht $pmworkplan -> Modul: Inviewedit" & Chr$(13) & "Line: " & Erl()
Exit Sub
End Sub
---------------------------------------------------------------------------------------------
Meine Frage:
Ich möchte gerne, wenn in einer Spalte in der Ansicht ein Wert eingetragen wird das er mir in dieses Dokument in 2 weiteren Feldern auch etwas einträgt.
Diese Felder werden nicht in der Ansicht angezeigt!
Ist das überhaupt möglich? Wenn ja, ic habe da leider keinen Ansatz wie man es lösen könnte!
Danke im vorhinein für eure Hilfe!
Mfg Horst
P.S.: Diesen Code habe ich aus der Hilfe!