getDocumentByUNID (NotesDatabase - JavaScript™)
Finds a document in a database, given the document universal ID (UNID).
Defined in
NotesDatabaseSyntax
getDocumentByUNID(unid:string) : NotesDocument
Parameters | Description |
---|---|
unid |
The universal ID of a document. |
Return value | Description |
---|---|
NotesDocument |
The document whose universal ID matches the parameter. |
Usage
For an explanation of universal IDs, see getUniversalID in NotesDocument. You can obtain the universal ID from getUniversalID or getParentDocumentUNID in NotesDocument.An exception occurs if the UNID is invalid.
Examples
This button gets a document given its UNID.try {
var unid:string = requestScope.query;
var doc:NotesDocument = database.getDocumentByUNID(unid);
requestScope.status = doc.getItemValueString("subject");
} catch(e) {
requestScope.status = "Invalid UNID";
}