This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
RE: Date format when using InViewEdit ~Tip Xanfanalitlen 7.Jan.04 10:39 PM a Web browser Applications Development 6.0Windows 2000
I know this is a long time after the initial post but perhaps it will be helpful to someone just starting to look at InViewEdit.
Like Alon, I started with an example script from the Domino Designer Help database. I removed script for NEWENTRY_REQUEST because I didn't want the ability to create a new doc at the view level, and the Help says not to use QUERY_REQUEST although I see in the other response to Alon's query that it should be used to provide date pickers or pick lists. I have not seen any example code here or in Help (even 6.5) that explains how to use it.
To make the column editable, tick the property "Editable column" in the column properties.
Then add script to the InViewEdit event. This is the simple script I used. Hope it points someone in the right direction.
Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)
%REM
This view has one editable column, which is for a date. All edits in views are "text" so I
convert the text value to a date before saving.
%END REM
REM Define variables
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim ws As New NotesUIWorkspace
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 Not using
Case VALIDATE_REQUEST
REM Cause validation error if user tries to exit column with no value
If Fulltrim(Columnvalue(0)) = "" Then
Messagebox "You must enter a value",, "No value in column"
Continue = False
End If
Case SAVE_REQUEST
REM Write the edited column view entry back to the document after converting the text to date format
Dim aDateV As Variant
aDateV = Datevalue(Columnvalue(0))
Call doc.ReplaceItemValue(Colprogname(0), aDateV)
Call doc.Save(True, True, True)
Case NEWENTRY_REQUEST
REM Not allowing create at view level