The conventional way is to create two forms or subforms with the same fields.
One with editable fields and the other with computed fields and change the form
The great disadvantage is that changes must be made on both forms. Depending on
the number of forms this can be very boring and take time.
The Solution is the script below in the Queryopendocument event of the view.
With this solution you must be very careful, because the security feature is
implemented in the view and not in the document. This means, that when user
have rights to create a view, it is possible to bypass this feature.
Sub Queryopendocument(Source As Notesuiview, Continue As Variant)
Continue = False
Dim dc As notesdocumentcollection
Set dc = source.documents
Dim doc As notesdocument
Set doc = dc.GetFirstDocument ' in the dc it is not possible to have
more then one doc
Dim Status As Integer
status = Cint(doc.status_key(0)) ' status is the key field on the form
Dim uidoc As notesuidocument
Dim ws As New notesuiworkspace
If status = 1 Then Print "Document is editable !" : Set uidoc =
ws.EditDocument( False , doc , False ) Else Print "Dokument is released !"
: Set uidoc = ws.EditDocument( False , doc , True )