Hi Everybody,A document with a text field x has a value 8.
This is selected in a view. There is validation in the the script to trap invalid values.
When view column is edited in notes and the value is modified to 8&. The Invalid value message is shown desired but thereafter notes
throws an error message “Error validating column value”.
Is there any solution to this problem ? I want to avoid this prompt message, but display my invalid message while validating
Thanks
Ankit
The inview edit script is as below
Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)
Const QUERY_REQUEST = 1
Const VALIDATE_REQUEST = 2
Const SAVE_REQUEST = 3
Const NEWENTRY_REQUEST = 4
REM Define variables
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 in Release 6.0
Case VALIDATE_REQUEST
Msgbox "Columnvalue(0) "&Columnvalue(0)
REM Cause validation error if user tries to exit column with no value
If Instr(Columnvalue(0)," ") Then
Continue = False
Msgbox “with space”
End If
If Instr(Columnvalue(0),“&”) Then
Continue = False
Msgbox “with&”
Exit Sub
End If
Case SAVE_REQUEST
REM Write the edited column view entries back to the document
For i = 0 To Ubound(Colprogname)
Call doc.ReplaceItemValue(Colprogname(i), Columnvalue(i))
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”, “Test”)
For i = 0 To Ubound(Colprogname)
Call doc.ReplaceItemValue(Colprogname(i), Columnvalue(i))
Next
REM Save(force, createResponse, markRead)
Call doc.Save(True, True, True)
End Select
End Sub