Subject: Inviewedit and dialog boxes -SOLUTION-
I know this is an old post, but i wanted to make sure anyone running across this would know that a solution does exist.
Here’s my sample code:
Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)
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 db As NotesDatabase
Dim doc As NotesDocument
Dim caret As String
REM Create Dialog Box for given column field
Dim values() As String
Dim value As String
If RequestType = QUERY_REQUEST And ColProgName(0) = "Types" Then
Redim values(5) As String
values(0) = "-DELETE-"
values(1) = "Document Store"
values(2) = "Discussion Database"
values(3) = "Data Store"
values(4) = "Process Support Database"
values(5) = "Group Mail Box"
value = ws.Prompt(PROMPT_OKCANCELLIST,"SELECT","Select a Type","",values)
End If
If RequestType = QUERY_REQUEST And ColProgName(0) = "Category" Then
Redim values(3) As String
values(0) = "-DELETE-"
values(1) = "Simple Database"
values(2) = "Simple Workflow"
values(3) = "Complex Workflow"
value = ws.Prompt(PROMPT_OKCANCELLIST,"SELECT","Select a Category","",values)
End If
REM Get the CaretNoteID - exit if it does not point to 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)
If doc Is Nothing Then Exit Sub
REM Select the request type
Select Case RequestType
Case QUERY_REQUEST
REM Check value and save doc with new value if valid
continue=False
If value = "" Then Exit Sub
If value = "-DELETE-" Then value =""
Call doc.ReplaceItemValue(Colprogname(0), value)
Call doc.Save(True, False)
Call ws.ViewRefresh
Case VALIDATE_REQUEST
REM Validate Changes
Case SAVE_REQUEST
REM Write the edited column view entries back to the document
Case NEWENTRY_REQUEST
REM Create document and create “Form” item
End Select
End Sub