I have developed a Training management system and users are required to confirm their participation (25 participants can be enrolled in 1 course). Once a document goes into edit mode the document is locked, the problem is that the client is not too happy about that. I even created a scheduled agent that checks if a document is locked for too long and send the administrator and the user an email; but the client is still not too happy.
Is there any other solution?
The client is telling me to do a time out i.e, after x minutes the document closes; is that possible?
Don’t know how to explain to them that since notesuidocument is not accessible from a scheduled agent, it is not possible to close the document. Please help…
Subject: Help with document locking
If you don’t want to have that locking feature, then you should make shure, that the database doesn’t allow locking. Take a look at the database properties, first tab, the corresponding option at the bottom should be deselected.
Otherwise, if you want to use the locking feature, and want to have a time out, maybe you could use a NotesTimer object in the form.
Does this answer your question?
Boerries
Subject: RE: Help with document locking
We have a similar app, and what I have done is added a simple ‘Enroll me’ button which adds the user’s name in the relevant fields. The user cannot go into edit mode, but can enroll.
Not sure if this would work for your app, but you might think of creating such a approach to quickly update the document, without locking it for long
Rakesh
Subject: RE: Help with document locking
Hi Boerries,I actually need the locking feature since it is possible that 2 user might want to confirm participation at the same time.
I have never used the NotesTimer object before, I have found an example on the Internet, where once the user clicks on a button a message appears telling him how long document is open.
Frankly I don’t know how to use the NotesTimer object to get a document closed, is it possible for you to help me or at least give me some hints. Thanks!!
Kind of crazy I am having to do all this, just because it is possible that a user edits the document and go for lunch or something; meaning others won’t be able to confirm participation.
Subject: RE: Help with document locking
Hello Gavinash,
first ensure that your NotesTimer object is globally available (in the form). So declare it in the (Globals) section of the form:
Dim obTimer As NotesTimer
The object should be created when the form has been opened, so put this into the PostOpen-Eventhandler:
Set obTimer = New NotesTimer(iSeconds%)
On Event Alarm From obTimer Call CloseLockedDoc
iSeconds% is for the interval, after which the timer will fire the Alarm event
The On Event statement binds the Alarm event to an eventhandler, which you need to write on your own. This may be named as you like, so here I chose CloseLockedDoc.
Add this Sub as an eventhandler to your form:
Sub CloseLockedDoc(obTimer As NotesTimer)
'Code here what you need to be done with your UI-Doc
End Sub
There is a good description and there are good examples in the Designer help.
Please let me know, if this helped.
Cheers, Boerries