Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1647
  • Last Modified:

Notes error: Invalid or nonexistent document ; when unlocking a document

This question is related to this question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_26551298.html

1. It was working last week and today it is giving me the error message
2. The form was created from a button that contains these code:
     @Command([FileSave]);
     @Command([Compose];"";"FlexRepairProcess");
3. The FlexRepairProcess form created and saved just fine but when I close the form, the code stops at the Queryclose event when it tries to unlock the document
     Sub Queryclose(Source As Notesuidocument, Continue As Variant)
       Dim doc As NotesDocument
       Set doc = source.Document
       Call doc.UnLock
     End Sub

Again this has been working for almost 2 weeks and suddenly it stopped working. I googled this problem and most people have problem with their mail files and that's not the case with me.
0
coronoahcoro
Asked:
coronoahcoro
  • 5
  • 3
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Do you have to unlock it explicitly, isn't the document automatically unlocked? Furthermore, why lock a new document?

If there is indeed a disk-based document (which I doubt), the error could be related to some sort of bug in Notes where it gets confused between two on-screen documents. Sometimes it's worth to grab NotesUIWorkspace.CurrentDocument instead of the Source parameter...
0
 
coronoahcoroAuthor Commented:
This happens only the very first time after the document is created, saved, and closed. The error doesn't show up anymore afterward. I can open and close document (+ unlocking it) just fine.
0
 
coronoahcoroAuthor Commented:
I had to do it explicitly because in the past when I tested this, there were times when a document is in locked status even though that doc was saved and close.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Sjef BosmanGroupware ConsultantCommented:
I suppose it won't work on a new (or newly saved) document. Can you just leave the lock in that case? Or, dirty: add a line with
      On Error Resume Next
right before the line with Unlock...
0
 
coronoahcoroAuthor Commented:
I just changed the Queryclose event to
	Dim doc As NotesDocument
	Set doc = source.Document
	If doc.LockHolders(0) <> "" Then
		Call doc.UnLock
	End If

Open in new window


It looks like it is working just fine now...I'm going to run some tests on it.
0
 
Sjef BosmanGroupware ConsultantCommented:
Don't delete the question, for it might help someone else with a similar problem. Just accept your own answer.
0
 
coronoahcoroAuthor Commented:
ok will do. thanks
0
 
coronoahcoroAuthor Commented:
This is what works in this case
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now