lockProvisional (NotesDocument - JavaScript™)
Locks a document provisionally.
Defined in
NotesDocumentSyntax
lockProvisional() : boolean
lockProvisional(name:string) : boolean
lockProvisional(names:java.util.Vector)
: boolean
Parameter | Description |
---|---|
name or names |
The name or 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. |
Return value | Description |
---|---|
true |
if the lock is placed |
false |
if the lock is not placed |
Usage
IsDocumentLockingEnabled in NotesDatabase must be true or this method throws an exception.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 throws an exception.
Examples
This button locks the current document for the current user.try {
var doc:NotesDocument = currentDocument.getDocument();
if (!database.isDocumentLockingEnabled()) {
database.setDocumentLockingEnabled(true);
}
if (doc.lockProvisional()) {
requestScope.status = "Document locked";
} else {
requestScope.status = "Document not locked";
}
} catch(e) {
requestScope.status = "Document not locked";
}