Prevent Editing A Document Depending On A Docstatus.

In most applications, released documents should not be editable by no person.
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 )

End Sub

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...