Solved

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

Posted on 2010-11-29
9
1,591 Views
Last Modified: 2013-12-18
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
Comment
Question by:coronoahcoro
  • 5
  • 3
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34232150
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
 
LVL 2

Author Comment

by:coronoahcoro
ID: 34232157
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
 
LVL 2

Author Comment

by:coronoahcoro
ID: 34232185
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34232399
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 2

Accepted Solution

by:
coronoahcoro earned 0 total points
ID: 34232518
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34434058
Don't delete the question, for it might help someone else with a similar problem. Just accept your own answer.
0
 
LVL 2

Author Comment

by:coronoahcoro
ID: 34435176
ok will do. thanks
0
 
LVL 2

Author Closing Comment

by:coronoahcoro
ID: 34459459
This is what works in this case
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now