Subject: So…
what you have is a single document carrying the current/next sequential number
and what you want is a way to ensure that two (or more) Notes clients are not updating that document at the same time?
In this case I suggest you look at locking the DOCUMENT using the NotesDocument.Lock method
see below for details or (of course) Designer help, However in summary
when a Notes Client executes a NotesDocument.Lock the code attempts to reach the admin server for that app and places a lock on the specified document that stops other Clients doing the same
i.e. it works between ‘threads’ running on separate machines
AND is only associated with one document
That seems to match your needs more closely that CodeLock
as the name implies Codelock is mostly used to stop two agents interfering with one another by running at the same time on the same server.
It achieves this by forcing each to grab control of a “transient” token by name.
Hope this helps … let us know how you get on
Locks a document.
Note This method is new with Release 6.
Defined in
NotesDocument
Syntax
flag = notesDocument.Lock( [ name ] [, provisionalOK ] )
Parameters
name
Array of type String. Optional. The names of the lock holders. Each lock holder must be a user or group. Defaults to one lock holder: the effective user. The empty string (“”) is not permitted in the array.
provisionalOK
Boolean. Optional.
True permits the placement of a provisional lock.
False (default) does not permit a provisional lock.
Return value
flag
Boolean.
True if the lock is placed.
False if the lock is not placed.
Usage
IsDocumentLockingEnabled in NotesDatabase must be True or this method raises an error.
This method:
Places a persistent lock if the administration (master lock) server is available.
Places a provisional lock if the administration server is not available and the second parameter is True.
Raises an error if the administration server is not available and the second parameter is False.
The following actions occur depending on the current lock status:
If the document is not locked, this method places the lock and returns True.
If the document is locked and the current user is one of the lock holders, this method returns True.
If the document is locked and the current user is not one of the lock holders, this method returns False.
If the document is modified by another user before the lock can be placed, this method raises an error.