Document Locking Problem

Hi,

Recently I’ve attempted to enable document locking in a database. The following scenarios happen:

  1. Create a new document by pressing a button from a view.

  2. Press a button which imports certain fields from another database, including Rich Text fields.

  3. This button has Lotusscript in it and after fields get loaded it closes the front end and reopens it in edit mode so that the Rich Text content appears.

    Call uidoc.Save

    Call uidoc.Close()

    Call doc.Save(True,True)

    Set uidoc2 = ws.EditDocument(False,doc)

    uidoc2.EditMode = True

On the Status bar the message that appears after the above steps are performed is “Document Successfully Unlocked”!!

If I press Save the message to save as a Save Conflict appears.

Through certain print messages in the code I’ve discovered that the QueryClose event runs as the last thing when the button is pressed.

Second Scenario.

  1. Create a new document by pressing a button from a view.

  2. Switch back to the view and from the outline go to another view (doesn’t matter which one)

  3. Go back to new document and repeat the steps from first scenario 2 and 3.

Document is correctly being locked and does not get unlocked.

My question is how can i make the document to remain locked and prevent it from unlocking?

Thank you in advance.