Manage Learn to apply best practices and optimize your operations.

Easy way to prevent any further editing of a document

This tip describes how to prevent any further editing of a document.

You Can View User Feedback To This Tip

If you would like to prevent any further editing of a document, do the following:


1. Create a text editable field called - LockEdit, give it a default value of "Unlock".

2. Create or add to your final action button the following code.

@SetField("LockEdit" ; "Lock");

3. Add the following code to Querymodechange event on the form.

 

 Sub Querymodechange(Source As Notesuidocument, Continue As Variant) If Not ( source.EditMode ) Then currentStatus = source.FieldGetText( "LockEdit" ) If ( currentStatus = "Lock" ) Then Messagebox _ ( "Document available for reading only." ) continue = False End If End If End Sub

USER FEEDBACK TO THIS TIP

 

  • There is an error in this coding. This only works when going from read mode to edit mode and this is not the case if an end user uses the edit smart icon or [ctrl E] to get into the document from a view. In either of those cases the document was never in read mode, so the querymodechange event never fires. To fix this problem the code also needs to be in an open event. —Darin Dutcher
  • This is regarding the Prevent Further Editing tip published on 9/23. There is one other piece that needs to be added. If a user opens the document using Ctrl-E, the QueryModeChange event does not trigger, yet the user is editing the document. So this save "LockEdit" code needs to be put into the QueryOpen event, to see if the document is being opened in Edit —Martie Ripson

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close